本文整理匯總了C#中System.Windows.Forms.TextBox.BeginInvoke方法的典型用法代碼示例。如果您正苦於以下問題:C# TextBox.BeginInvoke方法的具體用法?C# TextBox.BeginInvoke怎麽用?C# TextBox.BeginInvoke使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Forms.TextBox
的用法示例。
在下文中一共展示了TextBox.BeginInvoke方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SetTextBoxText
public void SetTextBoxText(TextBox anything, string text)
{
anything.BeginInvoke((MethodInvoker)delegate
{
anything.Text = text;
});
}
示例2: UpdateTextBoxInvoke
public void UpdateTextBoxInvoke(TextBox box, string displayText, int linesToshow)
{
Object[] args = new object[3];
args[0] = box;
args[1] = displayText;
args[2] = linesToshow;
box.BeginInvoke(textBoxDelegate, args);
}
示例3: AppendToTextBox
public static void AppendToTextBox(string text, TextBox txtBox)
{
if (txtBox.InvokeRequired)
{
txtBox.BeginInvoke(
new MethodInvoker(delegate() { AppendToTextBox(text, txtBox); })
);
}
else
{
txtBox.AppendText(text);
}
}
示例4: SetTextBoxText
public static void SetTextBoxText(TextBox textBox, string text)
{
if (textBox.InvokeRequired)
{
textBox.BeginInvoke(new Action(() =>
{
textBox.Text = text;
}));
}
else
{
textBox.Text = text;
}
}
示例5: AppendTextToTxtLog
public static void AppendTextToTxtLog(string str, TextBox t)
{
if (t.InvokeRequired)
{
t.BeginInvoke(new Action<string>(s =>
{
t.Text = string.Format("{0}\r\n{1}", s, t.Text);
}), str);
}
else
{
t.Text = string.Format("{0}\r\n{1}", str, t.Text);
}
}
示例6: SetTextboxMsg
/// <summary>
/// Method to update text on a textbox.
/// </summary>
/// <param name="msg">String type message</param>
/// <param name="box">Textbox to set text</param>
private void SetTextboxMsg(string msg, TextBox box)
{
if (box.InvokeRequired)
{
object[] pList = { msg, box };
box.BeginInvoke(new SetTextboxMsgCallBack(SetTextboxMsg), pList);
}
else
{
box.Text = msg;
}
}
示例7: UpdateStatus
private void UpdateStatus(TextBox lbl, string status)
{
if (lbl.InvokeRequired)
{
lbl.BeginInvoke(new Action<TextBox, string>(UpdateStatus), lbl, status);
}
else
{
lbl.Text = status;
lbl.Update();
lbl.Parent.Update();
}
}
示例8: SetTextBoxState
public void SetTextBoxState(TextBox anything, bool state)
{
anything.BeginInvoke((MethodInvoker)delegate
{
try
{
anything.Enabled = state;
}
catch
{
}
});
}
示例9: SetTextSafe
private void SetTextSafe(TextBox txtBox, string newText)
{
if (txtBox.InvokeRequired)
{
txtBox.BeginInvoke(_delegateSetTextSafe, txtBox, newText);
}
else
{
var sb = new StringBuilder(newText);
sb.Append(txtBox.Text);
txtBox.Text = sb.ToString();
}
}
示例10: ShowMsgInTextBox
public static void ShowMsgInTextBox(TextBox box, string msg, bool logInConsole = true)
{
if (box == null)
{
return; // TextBox對象不存在
}
else
{
MethodInvoker action = () => box.AppendText(msg + "\r\n");
try
{
box.BeginInvoke(action);
}
catch (InvalidOperationException ex)
{
BstLogger.Instance.Log(ex.ToString()); // 有的時候在顯示的時候TextBox已經被銷毀,忽略錯誤
}
}
if (logInConsole)
{
BstLogger.Instance.Log(msg);
}
}
示例11: SetText
// disposer chaque text recue a sa position finale
private static void SetText(TextBox box, string text)
{
if (box.InvokeRequired) //
box.BeginInvoke(new Action(() => SetText(box, text)));
else
box.Text = text;
}
示例12: SetText
void SetText(TextBox eb, string s)
{
if (eb.InvokeRequired)
eb.BeginInvoke(new SetTextDel(DoSetText), new object[] {eb, s});
else
DoSetText(eb, s);
}