I created an event handler for Textbox.Enter event , which selects a piece of text inside a text field, for example:
TextBox1.Select(3,5);
The result is as follows:

When a text field is entered through the keyboard using [Tab] or [Shift] - [Tab] ,
the part of the text to be selected is selected well, as in the screenshot above.
However, if the text field is entered not through the keyboard, but through the mouse,
then nothing is selected:

The following seems to be happening:
When we enter the text box with the mouse,
a click does raise the value of Enter event , but mouseclick also sets the location of the cursor to the location that the user clicked inside the text box.
And this cursor setting happens right after . The event handler has been started.
So, this means that the selection made by the event handler (with the line TextBox1.Select(3,5); ) is overridden by the location of the mouse,
and why entering the text box with the mouse seems to be picking nothing.
My question is:
How can I make the mouse really raise the Enter event , but not move the cursor position inside the text box?
Thus, I can make my choice (what happens in the code) and will not be redefined.
Edit:
The purpose of this is to provide easy selection of the MM: SS part, which is usually the edited part (the HH or mmm parts rarely change).
source share