So I have simple Windows application with RichTextBox component on form. The problem is when the form losts focus (notepad.exe runs near by on desktop) and then i click RichTextBox for selecting text - nothing happens, except form gets focus. The second click, when the form is already focused, works fine and text are now selected. The same problem with LinkClicked event in RichTextBox - it works only when clicked twice. How to change this behavior?
Asked
Active
Viewed 850 times
1
-
found a good answer in a similar thread: https://stackoverflow.com/a/47635568/6656775 – Nikolay Hidalgo Diaz Dec 16 '19 at 01:16
1 Answers
0
Try to use mouse_Click:
richTextBox1_mouseClick(...)
{
if(e.Buttons == MouseButtons.Left)
{
richTextBox1.Select();
}
}

r.mirzojonov
- 1,209
- 10
- 18
-
This is not what i meant. I just want to change the selection when form is in unfocused state, i.e. "MouseDown"->"MouseMove"->"MouseUp", but richTextBox is not reacting on this. TextBox component allow to do this, richTextBox - does not. – Jun 25 '13 at 12:45