ElectricEel
Programmer
Within a simple validation loop, I need to SelectAll text within a textbox control when invalid, however SelectAll is not available in the Control class. How can I go about this within the current loop? Pardon my ignorance if the answer is obvious.
Here's what I have:
Private Function ValidateInput() as Boolean
Dim ctlControl as Control
For Each ctlControl In Me.Controls
If TypeOf ctlControl Is TextBox Then
With ctlControl
.Focus()
'select all text in textbox ????
ValidateInput = False
Exit Function
End With
End If
Next
Return True
End Function
Here's what I have:
Private Function ValidateInput() as Boolean
Dim ctlControl as Control
For Each ctlControl In Me.Controls
If TypeOf ctlControl Is TextBox Then
With ctlControl
.Focus()
'select all text in textbox ????
ValidateInput = False
Exit Function
End With
End If
Next
Return True
End Function