B
bullshark
VSN03:C#
Create a C# Windows Form project.
Add two TextBox controls.
From the Properties of each, add an Enter Event handler.
In the generated Enter Event Handlers (textBox1_Enter & textBox2_Enter ),
add the code TextBox1.SelectAll(); and TextBox2.SelectAll();
Run the App.
When you run the app with a breakpoint at textBox1_Enter(), and
MOUSE to a field, the handler hits, executes SelectAll()
and nothing happens.
Bottom line: The event "hits" and SelectAll() does nothing.
If you TAB from field to field it works fine. The SelectAll
only fails when you MOUSE to a field. I believe that what is
happening is that the text is being selected and then
immediately repainted. My machine is too fast to see it.
Trying GotFocus is no help. Using the mouse events is out of
the question. It will interfere with normal selection.
In searching I've seen a number of complaints revolving around
this issue (none of which were implemented this way) and so
far I have turned up no solutions.
This should be easy to do, but how?
regards
bullshark
Create a C# Windows Form project.
Add two TextBox controls.
From the Properties of each, add an Enter Event handler.
In the generated Enter Event Handlers (textBox1_Enter & textBox2_Enter ),
add the code TextBox1.SelectAll(); and TextBox2.SelectAll();
Run the App.
When you run the app with a breakpoint at textBox1_Enter(), and
MOUSE to a field, the handler hits, executes SelectAll()
and nothing happens.
Bottom line: The event "hits" and SelectAll() does nothing.
If you TAB from field to field it works fine. The SelectAll
only fails when you MOUSE to a field. I believe that what is
happening is that the text is being selected and then
immediately repainted. My machine is too fast to see it.
Trying GotFocus is no help. Using the mouse events is out of
the question. It will interfere with normal selection.
In searching I've seen a number of complaints revolving around
this issue (none of which were implemented this way) and so
far I have turned up no solutions.
This should be easy to do, but how?
regards
bullshark