To fix the matter you need to perform following thing.
- You have to add a new class and simply set Super to the Textfield.
- Also you have to add property fGotFocus As Boolean into the newly created class.
- Now add following method into the code.
Code:
Sub GotFocus()
If fGotFocus = False then
fGotFocus = True
Me.SelectAll()
End If
End Sub
Sub LostFocus()
fGotFocus = False
End Sub
Function MouseDown(X As Integer, Y As Integer) As Boolean
If fGotFocus = False Then Return True
End Function
Sub MouseUp(X As Integer, Y As Integer)
Me.SetFocus()
End Sub
Bookmarks