本文整理汇总了C#中System.Windows.Forms.TextBoxBase.AppendText方法的典型用法代码示例。如果您正苦于以下问题:C# TextBoxBase.AppendText方法的具体用法?C# TextBoxBase.AppendText怎么用?C# TextBoxBase.AppendText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TextBoxBase
的用法示例。
在下文中一共展示了TextBoxBase.AppendText方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AppendText
public static void AppendText(TextBoxBase control, string text)
{
if (control.InvokeRequired)
control.Invoke(new AppendTextDelegate(AppendText), control, text);
else
control.AppendText(text);
}
示例2: LoadText
public static void LoadText (TextBoxBase sourceRichEdit, string fileName, bool excludeEmptyLines)
{
if (sourceRichEdit == null) throw new NolmeArgumentNullException ();
sourceRichEdit.Clear ();
//Win32RichEditUtility.BeginUpdate (sourceRichEdit);
if (File.Exists (fileName))
{
string [] aszAllLines = FileUtility.ReadAllLines (fileName, excludeEmptyLines,true);
string szBuffer = String.Concat (aszAllLines);
sourceRichEdit.AppendText (szBuffer);
}
//Win32RichEditUtility.EndUpdate (sourceRichEdit);
}
示例3: SetAppendText
/// <summary>
/// appends text for text boxes
/// </summary>
/// <param name="obj"></param>
/// <param name="text"></param>
private void SetAppendText(TextBoxBase obj, string text)
{
if (obj.InvokeRequired)
{
SetAppendTextCallback tcb = new SetAppendTextCallback(SetAppendText);
this.Invoke(tcb, new Object[] { obj, text });
}
else
{
obj.AppendText(text);
}
}
示例4: AppendTextInternalAsync
private void AppendTextInternalAsync(TextBoxBase textBox, string Text)
{
textBox.AppendText(Text);
}
示例5: SetMultiLine
/// <summary>
/// sets the given values as the holders textboxs text and checks for line breaks to properly set new lines
/// </summary>
/// <param name="values">string to set with new lines in it</param>
/// <param name="holder">textbox whose text to set</param>
private void SetMultiLine(string values, TextBoxBase holder)
{
if (values == null)
values = string.Empty;
string[] valuesSplit = Regex.Split(values, "\r\n|\r|\n");
int counter = 0;
foreach (string value in valuesSplit)
{
holder.AppendText(value);
if (++counter < valuesSplit.Length)
holder.AppendText(Environment.NewLine);
}
}
示例6: updateTextbox
public void updateTextbox(string msg, TextBoxBase uiControl)
{
if (this.InvokeRequired)
Invoke(new TextboxCallback(updateTextbox), msg, uiControl);
else
{
string message = DateTime.Now.ToString("[yyyyMMdd hh:mm:ss] ") + msg + Environment.NewLine;
uiControl.AppendText(message);
}
}