【发布时间】:2016-02-11 11:51:32
【问题描述】:
我试图突出显示 RichTextBox 中的整行。现在我有这个方法
if (Current != null)
{
selectStart = this.textBox.Text.Length;
foreach (string s in Current.Details)
{
this.textBox.AppendText(s + Environment.NewLine);
}
selectEnd = this.textBox.Text.Length;
this.textBox.Select(selectStart, selectEnd - selectStart);
this.textBox.SelectionBackColor = Color.FromArgb(51, 255, 51);
}
我希望代码突出显示整个行长。有没有办法做到这一点?
【问题讨论】:
-
也许您可以使用列表框并覆盖绘制事件?
-
并非如此。我需要它是一个 RichTextBox。