|
Hi,
How do you make the control enter that method?
Shouldn't there be some sort of callback declared?
|
|
|
|
|
However you like, you can call that method from a callback if desired.
If you are wanting to handle an event from a different thread without calling another method then just match up to the event signature as you do in your event handler to invoke the handler on the correct thread.
Dave<br>
<font size="-1">Tip: <a href="http://www.codeproject.com/tips/55555/Pass-value-between-forms-using-events.aspx">Passing values between objects using events (C#)</a></font><br>
<font size="-2">BTW, in software, hope and pray is not a viable strategy. (<a href="http://www.codeproject.com/Members/Luc-Pattyn">Luc Pattyn</a>)<br>Why are you using VB6? Do you hate yourself? (<a href="http://www.codeproject.com/script/Membership/View.aspx?mid=6556">Christian Graus</a>)</font>
|
|
|
|
|
This[^] deals with it.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Thank you guys, it works!
|
|
|
|
|
oracle uses a list of values component
i searched internet but i couldn't find anything similar in C# by the same name
is there other name for this component
any links or resources would be helpful
thanks in advance
excuse my bad language
|
|
|
|
|
Listbox[^]??Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
ListBox, ListView, DataGridView and this are just the standard components.
One nice custom control
|
|
|
|
|
I have a datagrid that is having values from a database. I need the values in the second column (being zero index based, i know if there is any indexing i will index as 1) but i am totally unable to get these items. i don't want to query the database again because this will slow down my system so much. please assist on how i can get this items.
I tried this but did not work:
ArrayList percentages = new ArrayList();
percentages.AddRange(dataGridInfo.Columns[1]); Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
If you need [Edit] to process [/Edit] them(the datas) in memory I would go for a List<YourClass> myList
and then set the datagrid.DataSource = myList;
Somethin like:
public ... GetDatas(){
cmd.CommandText = "SELECT * FROM XYZ";
SQLDataReader dr = cmd.ExecuteReader();
MyClass curr = null;
List<MyClass> lst = new List<MyClass>;
while(dr.Read()){
curr = new MyClass();
curr.Myprop1 = dr.GetString(0);
...
lst.Add(curr);
}
...
return lst;
}
var myList = GetDatas();
dataGridView1.DataSource = myList
Now you have the List and you can LINQ or whatever;modified on Sunday, February 28, 2010 11:35 AM
|
|
|
|
|
Is this the asp.net gridview of the winforms datagridview, 2 very different beasites.
Winforms you can use datagridview.columns[index] to get the column.Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Try this code sure it will help you
Label myLabel = (Label)myGridView.Rows[myGridView.SelectedIndex].Cells[2].FindControl("myLabel");
|
|
|
|
|
Hi all. I would like to add sliding panels like the ones in visual studio for tools. is there such a control? Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
did you search the CodeProject articles? there are several on the subject.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Here is the best link i have seen so far but i want to know if there exist a control for that.
http://www.codeproject.com/Messages/2663987/Re-panels.aspx[^]Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
When someone responds to your question, if you use the "Reply" on the message they post, then your message is added to theirs, and they get an email to say you have more information / further questions for them. Otherwise, you just have to wait and hope they see your new input - not guaranteed. You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:08am.
|
|
|
|
|
Thank you a million fold. You are super cool Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
hi
i was filling checkedListBox like this:
SQL = "select distinct TrapName,substr(TrapNum,1,4) from TrapTbl order by substr(TrapNum,1,4) ";
adp = new OracleDataAdapter(SQL, Conn);
dsView = new DataSet();
adp.Fill(dsView, "TrapTbl");
adp.Dispose();
this.ListAtar.DataSource = dsView.Tables[0];
this.ListAtar.DisplayMember = dsView.Tables[0].Columns[0].ColumnName;
this.ListAtar.ValueMember = dsView.Tables[0].Columns[1].ColumnName;
my question is, when i pick some items from the checkedListBox
and i press a button - how to get a list of the ID - the ValueMember ??
thank's in advance
|
|
|
|
|
you need to use ItemCheck event like this
private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (e.NewValue == CheckState.Checked)
{
Console.WriteLine(checkedListBox1.SelectedValue.ToString());
}
} Life's Like a mirror. Smile at it & it smiles back at you.- P Pligrim
|
|
|
|
|
Make sure that your check box property that is autopostback is true.
|
|
|
|
|
I have made an app that has a webBrowser and uploads via ftp. When testing in the Visual C# IDE, all is well - the browser loads fine and ftp connections are established, allowing files to be uploaded successfully.
However, upon running the exe from my xp desktop, the browser control fails to load, and ftp does not connect After scouring the internet for related posts and demos I'm still not sure why this could be. Incidentally, the other browser demos do not load either, so I'm inclined to think that it must be my firewall, port, other xp settings.
In a quick check in dos, port 21 (which is required apparently for ftp) is *not* open. Nor is port 80.. Should I need to speak to my isp about this? Why can I run the program ok in the ide? Is the compile failing to package any required connectivity associated files?
I very much hope that someone can help modified on Saturday, February 27, 2010 7:47 PM
|
|
|
|
|
Hi,
I don't know what is causing this; I think I do know how to find out: make sure your code reports all possible problems, i.e. when a try-catch block is present, make sure the catch block reports the entire exception using Exception.ToString() either to a MessageBox, a log file, or anything else that is accessible to the user. Also when methods return a status value, make sure to test it and log all anomalies. That way, the program itself should find out and tell you what exactly is failing, thus providing a clue as to how to fix it.
Also make sure all exceptions will be caught:
- put a big try-catch around the top-level method executed by each thread or background worker;
- put a big try-catch block around the content of your static Main() method;
- add an Application.ThreadException handler that logs the exception.
Good luck.Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Thanks for your concern and the good advice. I will try that although there isnt a whole lot to catch in my entire code, especially the webBrowser (I've stripped it down to it's bare basic, even less code than its origin, from the standard C# Studio 2008 tutorial):
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
}
Outside of the IDE, the browser doesn't load ('navigation has been canceled') and the ftp doesn't connect (I'm already catching it on initial WebRequest requestcreate = WebRequest.Create("ftp://..."), so it's easy to spot what is breaking. I've been considering adapting some code I found for firewall exceptions - should this really be necessary for the default web browser control?
I *do* very much hope that someone can recommend another way of testing my port and firewall settings with regards to this issue. I am certain that it can be resolved in windows rather than debugging my code, so if anyone knows of any good network diagnostic software or dos network/socket/port commands that may help, please do tell me!
By the way when I right click and choose properties on the page I get hef="res://ieframe.dll/ErrorPageTemplate.css..."
I have searched about res://ieframe.dll/ to no avail as of yet.modified on Saturday, February 27, 2010 8:35 PM
|
|
|
|
|
It was Comodo anti-virus! lol
|
|
|
|
|
I have a web-browser control and a HTML tag inside which im not familiar with.
Anyway ive filled in the form with the set attribute method and invoked its submit button with this delay directly underneath
while (LoginBrowser.IsBusy == true)
{
Application.DoEvents();
}
This works when the credentials are correct but im trying to detect when invalid credentials are entered in which case a massage is somehow injected into the HTML even when javascript is disabled in the browser.
TextWriter tw = new StreamWriter("output.htm");
tw.WriteLine(LoginBrowser.DocumentText);
tw.Close();
System.Diagnostics.Process.Start("output.htm");
The above is spitting out the original html form without the error message so my problem is finding a way to reliably detect when the code has been injected .
Ive tried using the Document completed event but the browser isnt navigating anywhere.modified on Saturday, February 27, 2010 4:23 PM
|
|
|
|