日期:2014-05-17 浏览次数:21184 次
/// <summary>
/// 选中行
/// </summary>
/// <param name="line">行号,从0开始</param>
private void selectLine(int line)
{
int start = this.richTextBox1.GetFirstCharIndexFromLine(line);
int length = this.richTextBox1.GetFirstCharIndexFromLine(++line);
if (start == -1)
return;
else if (length == -1)
length = this.richTextBox1.TextLength - start;
else
length = length - start;
this.richTextBox1.Select(start, length);
richTextBox1.SelectionFont = new System.Drawing.Font("宋体 ",10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
}