Simple question, I had an application in console mode. Every thing would write in the console using Console.WriteLine
. However, now I have a form and a listbox. I know easily how to do it, however, what is the proper way to do it?
Asked
Active
Viewed 45 times
-1

Cher
- 2,789
- 10
- 37
- 64
-
1Proper way to do WHAT? – aquinas Jan 20 '17 at 18:11
1 Answers
1
You can access the UI from another thread using delegate, simple and neat:
this.Invoke((MethodInvoker)delegate
{
textBox1.Value = "your text";
});

NicoRiff
- 4,803
- 3
- 25
- 54
-
thanks a lot for you answer. Can you tell me where I go wrong? Here is my code : this.Invoke((MethodInvoker)delegate { lstStatus.Items.Add("test"); }); – Cher Jan 21 '17 at 22:04