I had a simple function written in VB 6 for selecting all the text in a textbox when it got focus. Does anyone know how to to the same in VB 2005.
Public Sub Highlight()
With Screen.ActiveForm
If (TypeOf .ActiveControl Is TextBox) Then
.ActiveControl.SelStart = 0
.ActiveControl.SelLength = Len(.ActiveControl)
End If
End With
End Sub
The SelStart and SelLength methods don't appear to exist in VB.Net.
Public Sub Highlight()
With Screen.ActiveForm
If (TypeOf .ActiveControl Is TextBox) Then
.ActiveControl.SelStart = 0
.ActiveControl.SelLength = Len(.ActiveControl)
End If
End With
End Sub
The SelStart and SelLength methods don't appear to exist in VB.Net.