public void listbox(String text) { if (this.listBox1.InvokeRequired) { SetTextCallbacks d = new SetTextCallbacks(setListbox); this.Invoke(d, new object[] { text }); } else { // It's on the same thread, no need for Invoke this.listBox1.TopIndex = this.listBox1.Items.Add(text); //this.labelStop.ForeColor = cor; } }
private void labelStopSet(String text, Color cor) { if (this.labelBb.InvokeRequired) { SetTextCallbacks d = new SetTextCallbacks(setLabelStop); this.Invoke(d, new object[] { text, cor }); } else { // It's on the same thread, no need for Invoke this.labelStop.Text = text; this.labelStop.ForeColor = cor; } }