Click here to Skip to main content
15,893,508 members
Home / Discussions / C#
   

C#

 
QuestionHard Question about display screen Pin
Yanshof5-Oct-06 9:15
Yanshof5-Oct-06 9:15 
AnswerRe: Hard Question about display screen Pin
Chris Buckett5-Oct-06 9:27
Chris Buckett5-Oct-06 9:27 
GeneralI need to know how to do it ... and i dont need something Pin
Yanshof5-Oct-06 9:32
Yanshof5-Oct-06 9:32 
GeneralRe: I need to know how to do it ... and i dont need something Pin
Dan Neely5-Oct-06 9:46
Dan Neely5-Oct-06 9:46 
GeneralRe: I need to know how to do it ... and i dont need something Pin
Chris Buckett5-Oct-06 21:35
Chris Buckett5-Oct-06 21:35 
QuestionLoading Treeview in the Background Pin
smarttom995-Oct-06 8:21
smarttom995-Oct-06 8:21 
AnswerRe: Loading Treeview in the Background Pin
hdv2125-Oct-06 8:33
hdv2125-Oct-06 8:33 
GeneralRe: Loading Treeview in the Background Pin
louthy5-Oct-06 17:01
louthy5-Oct-06 17:01 
Or even easier (if you're using .NET 2.0) is to drop a BackgroundWorker process onto the form. It's DoWork event will fire a method on the form where you can do your processing.

Be warned however, that Windows Forms aren't thread safe, so any manipulation of the form controls requires jumping back onto the main thread using Control.Invoke or Control.BeginInvoke to call a delegate. Eg.

<br />
public partial class MyForm<br />
{<br />
   // Your delegate definition.  It basically defines the prototype of the method.<br />
   delegate void AddItemDelegate(string text);<br />
<br />
   // Method for adding a single item to your list<br />
   private void AddItem(string text)<br />
   {<br />
       if (InvokeRequired)<br />
       {<br />
           // We're not in the UI thread, so we need to call BeginInvoke<br />
           BeginInvoke(new AddItemDelegate(AddItem), new object[] { text });<br />
	   return;<br />
       }<br />
       myListBox.Items.Add(text);<br />
   }<br />
<br />
   // Your DoWork event <br />
   private void myListBox_DoWork(object sender, DoWorkEventArgs e)<br />
   {<br />
       foreach( string item in myList )<br />
       {<br />
           AddItem(item);<br />
       }<br />
   }<br />
}<br />

QuestionKeep a dialog open if OK hit and error occured Pin
kozu5-Oct-06 8:14
kozu5-Oct-06 8:14 
AnswerRe: Keep a dialog open if OK hit and error occured Pin
Chris Buckett5-Oct-06 8:59
Chris Buckett5-Oct-06 8:59 
GeneralRe: Keep a dialog open if OK hit and error occured Pin
kozu5-Oct-06 9:46
kozu5-Oct-06 9:46 
QuestionRestrict multiple instance of my application Pin
Nadia Monalisa5-Oct-06 6:21
Nadia Monalisa5-Oct-06 6:21 
AnswerRe: Restrict multiple instance of my application Pin
ntrn05-Oct-06 6:38
ntrn05-Oct-06 6:38 
AnswerRe: Restrict multiple instance of my application Pin
asator5-Oct-06 6:54
asator5-Oct-06 6:54 
QuestionSkype Chat SendMessage Textbox ? Pin
ntrn05-Oct-06 5:49
ntrn05-Oct-06 5:49 
AnswerRe: Skype Chat SendMessage Textbox ? Pin
aamironline5-Oct-06 6:14
aamironline5-Oct-06 6:14 
GeneralRe: Skype Chat SendMessage Textbox ? Pin
ntrn05-Oct-06 6:30
ntrn05-Oct-06 6:30 
QuestionHow to print Datagrid in C# ? Pin
hdv2125-Oct-06 5:38
hdv2125-Oct-06 5:38 
QuestionObject Oriented Graphics issue Pin
vineas5-Oct-06 5:27
vineas5-Oct-06 5:27 
AnswerRe: Object Oriented Graphics issue Pin
User 66585-Oct-06 5:41
User 66585-Oct-06 5:41 
AnswerRe: Object Oriented Graphics issue Pin
aamironline5-Oct-06 6:06
aamironline5-Oct-06 6:06 
GeneralRe: Object Oriented Graphics issue Pin
vineas5-Oct-06 7:36
vineas5-Oct-06 7:36 
QuestionDll to XML Pin
gmellado5-Oct-06 5:17
gmellado5-Oct-06 5:17 
QuestionDatabase Copy and Paste Pin
Spudwars5-Oct-06 4:30
Spudwars5-Oct-06 4:30 
AnswerRe: Database Copy and Paste Pin
Chris Buckett5-Oct-06 9:05
Chris Buckett5-Oct-06 9:05 

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.