M
Mario
Hi there,
I'm trying to do an easy thing... but no luck so far...
I have a form with a textbox, and I want the following behaviour on mouse
click event:
-if no text is selected, select all
-if some (or all) text is selected, unselect all
This looks good... but doesn't work! :-(
Private Sub TextBox1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TextBox1.Click
If TextBox1.SelectionLength > 0 Then
TextBox1.Select(0, 0)
Else
TextBox1.SelectAll()
End If
End Sub
I set a breakpoint on "TextBox1.Select(0,0)", never stops there; and I dont
see why?
How can I get the behaviour I want?
Please help me... to master this nasty TextBox!
Regards,
Mario
I'm trying to do an easy thing... but no luck so far...
I have a form with a textbox, and I want the following behaviour on mouse
click event:
-if no text is selected, select all
-if some (or all) text is selected, unselect all
This looks good... but doesn't work! :-(
Private Sub TextBox1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TextBox1.Click
If TextBox1.SelectionLength > 0 Then
TextBox1.Select(0, 0)
Else
TextBox1.SelectAll()
End If
End Sub
I set a breakpoint on "TextBox1.Select(0,0)", never stops there; and I dont
see why?
How can I get the behaviour I want?
Please help me... to master this nasty TextBox!
Regards,
Mario