public void Enable() { if (txtOutput.InvokeRequired) { var d = new SafeCallDelegate2(Enable); btnOK.Invoke(d, new object[] { }); } else { btnOK.Enabled = true; } }
public void SetText(string value) { if (txtMessage.InvokeRequired) { var d = new SafeCallDelegate2(SetText); Invoke(d, new object[] { value }); } else { txtMessage.Text = value; } }
private void Reset() { if (console.InvokeRequired) { var d = new SafeCallDelegate2(Reset); console.Invoke(d); } else { export.Enabled = true; this.Cursor = Cursors.Default; } }
//output errors to the status bar at the bottom private void displayError(string text) { if (txtOutput.InvokeRequired) { var d = new SafeCallDelegate2(displayError); txtOutput.Invoke(d, new object[] { text }); return; } else { txtOutput.AppendText(text); txtOutput.AppendText(Environment.NewLine); //statusText.Text = text; } }
public void displayMessage(string text) { if (txtOutput.InvokeRequired) { var d = new SafeCallDelegate2(displayMessage); txtOutput.Invoke(d, new object[] { text }); return; } else { txtOutput.Text = text; if (ckbAutoscroll.Checked) { txtOutput.SelectionStart = txtOutput.Text.Length; txtOutput.ScrollToCaret(); } } }
private void PrintPerm(List <byte> permSet, int lp) { string perm = lp.ToString() + ".\t[ "; foreach (byte element in permSet) { perm += element.ToString() + " "; } perm += "]\n"; if (richTextBox1.InvokeRequired) { var d = new SafeCallDelegate2(PrintPerm); try { richTextBox1.Invoke(d, new object[] { permSet, lp }); } catch (System.ComponentModel.InvalidAsynchronousStateException) { computationThread.Join(); } } else { richTextBox1.AppendText(perm); } }