本文整理汇总了C#中System.Windows.Forms.RichTextBox.ResetText方法的典型用法代码示例。如果您正苦于以下问题:C# RichTextBox.ResetText方法的具体用法?C# RichTextBox.ResetText怎么用?C# RichTextBox.ResetText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.RichTextBox
的用法示例。
在下文中一共展示了RichTextBox.ResetText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisplayToRaceInfo
private void DisplayToRaceInfo(RichTextBox box, String[] values)
{
box.ResetText();
box.AppendText("RACING WITH:" + values[0] + Environment.NewLine);
String[] data = values[1].Split('\t');
box.AppendText("Afstand: " + (int.Parse(data[3])/10.0) + " km" + Environment.NewLine);
box.AppendText("Tijd: " + data[6] + Environment.NewLine);
box.ScrollToCaret();
}
示例2: CheckStatusField
public void CheckStatusField(RichTextBox statusbox)
{
if (_timercount % 17 == 1)
{
statusbox.ResetText();
}
}
示例3: SetRtfBoxText
/// <summary>
/// Output 'from' string to rtfBox and mark all possible changes.
/// It returns the count of possible changes
/// </summary>
/// <param name="rtfBox"></param>
/// <param name="from"></param>
/// <returns></returns>
public int SetRtfBoxText(RichTextBox rtfBox, string from)
{
int foundChanges = 0;
rtfBox.ResetText();
rtfBox.SelectionBackColor = Color.AliceBlue;
//rtfBox.Text = "";
int posInText = 0;
Match match = _regExPattern.Match(from);
while (match.Success)
{
foundChanges += foundChanges;
// output not outputted text
if ((match.Index - posInText) > 0)
{
rtfBox.SelectionBackColor = Color.AliceBlue;
rtfBox.AppendText(from.Substring(posInText, match.Index - posInText));
}
rtfBox.SelectionBackColor = Color.Gold;
rtfBox.AppendText(match.Value);
posInText = match.Index + match.Length;
match = match.NextMatch();
}
if ((from.Length - 1 - posInText) >= 0)
{
rtfBox.SelectionBackColor = Color.AliceBlue;
rtfBox.SelectionBackColor = Color.AliceBlue;
rtfBox.AppendText(from.Substring(posInText, from.Length - posInText));
}
return foundChanges;
}