RichTextBox
有没有办法使用事件来确定文本的颜色mousemove
?我想避免使用Richtextbox.Select
,因为它会在鼠标移动的任何地方添加一个小选择栏。
private void rtbComputerstatus_MouseMove(object sender, MouseEventArgs e)
{
int c = rtbComputerstatus.GetCharIndexFromPosition(new Point(e.X, e.Y));
rtbComputerstatus.Select(c, 1);
if (rtbComputerstatus.SelectionColor == Color.Blue)
rtbComputerstatus.Cursor = Cursors.Hand;
else
rtbComputerstatus.Cursor = Cursors.Default;
}