当鼠标指针悬停在RichTextBox中的粗体单词上时,我希望将光标更改为HAND。如何实现?
当鼠标指针悬停在RichTextBox中的粗体单词上时,我希望将光标更改为HAND。如何实现?
private void richTextBox2_MouseMove(object sender, MouseEventArgs e)
{
int c = richTextBox2.GetCharIndexFromPosition(new Point(e.X, e.Y));
richTextBox2.Select(c, 1);
if (richTextBox2.SelectionFont.Bold)
{
richTextBox2.Cursor = Cursors.Hand;
}
else
{
richTextBox2.Cursor = Cursors.Default;
}
}