J Trahair
Well-known member
In old VB6, I could set all txtBox controls when members of the same index eg. txtBox(0), txtBox(1) etc., to all do certain things in a couple of lines of code, eg.
in this case, every time the focus enters a txtBox, the value appears in a blue highlight with the cursor at the end. This gives consistent behaviour in all txtBoxes, not just with GotFocus, but trapping of keyboard characters and Enter, etc.
Seeing as how VB2005 Pro doesn't allow TextBoxes to belong to an Indexed collection, how do I handle consistency without a separate event for each TextBox for each property/method? Just imagine I might have 48 TextBoxes.
Thanks in advance.
VB.NET:
Private Sub txtBox_GotFocus(Index As Integer)
txtBox(Index).SelStart = 0
txtBox(Index).SelLength = Len(txtBox(Index))
End Sub
Seeing as how VB2005 Pro doesn't allow TextBoxes to belong to an Indexed collection, how do I handle consistency without a separate event for each TextBox for each property/method? Just imagine I might have 48 TextBoxes.
Thanks in advance.