Click here to Skip to main content
15,914,905 members
Home / Discussions / C#
   

C#

 
GeneralRe: Mobile phone controlling... Pin
mikker_1238-May-04 23:50
mikker_1238-May-04 23:50 
GeneralRe: Mobile phone controlling... Pin
Heath Stewart9-May-04 2:26
protectorHeath Stewart9-May-04 2:26 
GeneralDisabling character in combo box Pin
DougW486-May-04 20:43
DougW486-May-04 20:43 
GeneralRe: Disabling character in combo box Pin
Aryadip6-May-04 23:04
Aryadip6-May-04 23:04 
GeneralRe: Disabling character in combo box Pin
DougW486-May-04 23:30
DougW486-May-04 23:30 
GeneralRe: Disabling character in combo box Pin
Heath Stewart7-May-04 3:14
protectorHeath Stewart7-May-04 3:14 
GeneralPopulating TreeViews with data acquired from void static callback methods Pin
inyoursadachine6-May-04 17:20
inyoursadachine6-May-04 17:20 
GeneralRe: Populating TreeViews with data acquired from void static callback methods Pin
Heath Stewart6-May-04 18:16
protectorHeath Stewart6-May-04 18:16 
Yes you should use Control.Invoke. This invokes the call on the thread on which the control was created, which is important. You should do this for your ListView as well. Modifying the control from a different thread causes problems in the message queue. The technical details get down into what is encapsulated by the .NET Framework (much of it, anyway): Win32 APIs.

To use Invoke, take a look at this sample code to safely add a TreeNode in the property thread:
internal void SafeAdd(TreeNodeCollection nodes, TreeNode node)
{
  if (nodes == null || node == null)
    throw new ArgumentNullException(nodes == null ? "nodes" : "node");
 
  if (treeView1.InvokeRequired)
  {
    Delegate d = new AddTreeNodeHandler(nodes.Add);
    treeView1.Invoke(d, new object[] {node});
  }
  else nodes.Add(node);
}
private delegate int AddTreeNodeHandler(TreeNode node);


 

Microsoft MVP, Visual C#
My Articles
GeneralIdentifying a SOAP call Pin
Aryadip6-May-04 17:18
Aryadip6-May-04 17:18 
GeneralRe: Identifying a SOAP call Pin
Heath Stewart6-May-04 18:07
protectorHeath Stewart6-May-04 18:07 
GeneralMouse Click Problem Pin
Member 6910896-May-04 16:36
Member 6910896-May-04 16:36 
GeneralRe: Mouse Click Problem Pin
Aryadip6-May-04 18:01
Aryadip6-May-04 18:01 
GeneralRe: Mouse Click Problem Pin
Heath Stewart6-May-04 18:05
protectorHeath Stewart6-May-04 18:05 
GeneralMSMQ Peek Callbacks and duplicate messages Pin
inyoursadachine6-May-04 13:20
inyoursadachine6-May-04 13:20 
Generalmultiline display in dataGridColumn textBox Pin
blankg6-May-04 12:24
blankg6-May-04 12:24 
GeneralRe: multiline display in dataGridColumn textBox Pin
Heath Stewart6-May-04 18:20
protectorHeath Stewart6-May-04 18:20 
GeneralRe: multiline display in dataGridColumn textBox Pin
blankg7-May-04 1:55
blankg7-May-04 1:55 
GeneralRemoting/Serializing Pin
markkow6-May-04 11:23
markkow6-May-04 11:23 
GeneralRe: Remoting/Serializing Pin
Heath Stewart6-May-04 11:58
protectorHeath Stewart6-May-04 11:58 
GeneralRe: Remoting/Serializing Pin
markkow6-May-04 12:15
markkow6-May-04 12:15 
GeneralRe: Remoting/Serializing Pin
Heath Stewart6-May-04 17:52
protectorHeath Stewart6-May-04 17:52 
GeneralRe: Remoting/Serializing Pin
markkow7-May-04 16:34
markkow7-May-04 16:34 
GeneralRe: Remoting/Serializing Pin
Heath Stewart8-May-04 19:18
protectorHeath Stewart8-May-04 19:18 
GeneralRe: Remoting/Serializing Pin
markkow9-May-04 5:40
markkow9-May-04 5:40 
GeneralToolBar.BackColor Pin
Anonymous6-May-04 10:37
Anonymous6-May-04 10:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.