On Aug 29, 5:19 pm, "lmeff...@gmail .com" <lmeff...@gmail .comwrote:
Is there a way to modify all textboxes on a form so that when you
click on any of them you process the SelectAll() function.
For exaple, let's say I've created a form with 30 textboxes. These
textboxes when clicked on, will select all of the text inside of them
using the textbox.selecta ll(). I'm hoping to do this without creating
30 different Subs. How do I do it?
Ok, I found a way, but it's still pretty lengthy.
I merely used a single mousedown event for one textbox and added a few
textboxes to the handles and then proceeded to use the sender.
Private Sub uione_MouseDown _
(ByVal sender As Object, ByVal e As
System.Windows. Forms.MouseEven tArgs) _
Handles uione.MouseDown , _
uitwo.MouseDown , _
uithree.MouseDo wn, _
uifour.MouseDow n
sender.SelectAl l()
End Sub
I kind of want to avoid that cause it seems a little slow and I'm
wanting to streamline the code. But if that's the way to do it, then
so be it.