The following code snippet shows how to set cursor on the current position when mouse rightclick button is clicked.
private void richTextBox1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
int index = richTextBox1.GetCharIndexFromPosition(e.Location);
richTextBox1.Select(index, 0);
}
}
C# RichTextBox WinForms control settings
ReplyDelete