public void writing2(Label l, string a) { if (l.InvokeRequired) { TextDegisDelegate del = new TextDegisDelegate(writing); l.Invoke(del, new object[] { a }); } else { l.Text = a; } }
public void writing(string a) { if (listBox1.InvokeRequired) { TextDegisDelegate del = new TextDegisDelegate(writing); listBox1.Invoke(del, new object[] { a }); } else { listBox1.Items.Add(a); } }