Created with colorer-take5 library. Type 'csharp'
0: using System;
1: using System.Windows.Forms;
2: using System.Threading;
3:
4: namespace TestWinForm
5: {
6: public partial class TestCallBackFromDiferentThread : Form
7: {
8: private System.Threading.Thread workerThread;
9:
10: public TestCallBackFromDiferentThread()
11: {
12: InitializeComponent();
13: }
14:
15: private void button1_Click(object sender, EventArgs e)
16: {
17: ThreadStart ts = new ThreadStart(AddNewLine);
18: workerThread = new Thread(ts);
19: workerThread.Start();
20: }
21:
22: private void AddNewLine()
23: {
24: listBox1.Items.Add(textBox1.Text);
25: }
26: }
27: }
Bom, a resposta eu posto depois!
Adriano
[+/-] mostrar/esconder este post