Problem with ToolStripTextBox

  • Thread starter Thread starter Lloyd Sheen
  • Start date Start date
L

Lloyd Sheen

I just want to select the complete text when someone enters the textbox
(mouse click etc.). When I am executing within the IDE (VS 2005 Pro) no
problem.

Execute outside the IDE and no select takes place.


Code:

Private Sub tbSearchTxt_Enter(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles tbSearchTxt.Enter
' select all text to make paste of new info easier
tbSearchTxt.SelectAll()
End Sub

Any ideas or is that control broken?

Lloyd Sheen
 
Lloyd Sheen said:
I just want to select the complete text when someone enters the textbox
(mouse click etc.). When I am executing within the IDE (VS 2005 Pro) no
problem.

Execute outside the IDE and no select takes place.


Code:

Private Sub tbSearchTxt_Enter(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles tbSearchTxt.Enter
' select all text to make paste of new info easier
tbSearchTxt.SelectAll()
End Sub

Any ideas or is that control broken?

Lloyd Sheen

More info. It seems the only reason it worked in IDE is the breakpoint. No
breakpoint no code execution it seems. Now I put a msgbox in the handler
code and it works both in IDE and as executable outside the IDE. Some
pretty weird stuff going on here.

LS
 
It is not just the ToolStripTextBox, all text boxes work this way. Why not
just put your selectall in the click event?
 
Terry said:
It is not just the ToolStripTextBox, all text boxes work this way. Why
not
just put your selectall in the click event?

Thanks, did that and works like a charm. Wonder why clicking is not seen as
entering..

Oh well

LS
 
Here is my guess... clicking does the enter but then starts a new 'select'
ending with the mouse up event. If you do other things like change the
background and font colors in the 'enter' event, it works fine. So my guess
is that the the text is getting selected in the enter and then deselected by
the mouse events.
 
Back
Top