Problem with ToolStripTextBox

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
 
L

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
 
G

Guest

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

Lloyd Sheen

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top