private void InvokeClearTextBox(UIRichTextBox box) { if (box.InvokeRequired) { InvokeClearTextBoxDelegate d = InvokeClearTextBox; box.Invoke(d, box); } else { box.ClearUndo(); } }
/// <summary> /// 多线程访问控件委托,在RickTextBox中显示数据 /// </summary> public static void showDataInRichTextBox(ref UIRichTextBox textBox, string data) { if (textBox.InvokeRequired) { showDataInRichTextBoxDelegate d = showDataInRichTextBox; textBox.Invoke(d, textBox, data); } else { textBox.Text = data; } }
private void InvokeAppendTextAction(UIRichTextBox txtBox, string message) { if (txtBox.InvokeRequired) { InvokeAppendTextActionDelegate d = InvokeAppendTextAction; txtBox.Invoke(d, txtBox, message); } else { txtBox.AppendText(message); } }