When something loses Focus, the LostFocus event is called. I have a toggle button which changes color when clicked and which unlocks a second form element (which should almost never be changed, so it's usually locked to prevent inadvertant changes). I want to write something like the following:
Private Sub Protection_Button_LostFocus()
If [Protected Field].hasFocusOrSomething = False Then
[Protected Field].Locked = True
End Sub
The only problem is that there isn't a hasFocus property. Is there a "giveFocus()" property? Can I say something like the following:
Private Sub Protected_Button_OnClick()
[Protected Button].Locked = False
[Protected Button].giveFocusToOrSomethingLikeThat
End Sub
Private Sub Protected_Field_LostFocus()
[Protected Field].Locked = True
End Sub
Private Sub Protection_Button_LostFocus()
If [Protected Field].hasFocusOrSomething = False Then
[Protected Field].Locked = True
End Sub
The only problem is that there isn't a hasFocus property. Is there a "giveFocus()" property? Can I say something like the following:
Private Sub Protected_Button_OnClick()
[Protected Button].Locked = False
[Protected Button].giveFocusToOrSomethingLikeThat
End Sub
Private Sub Protected_Field_LostFocus()
[Protected Field].Locked = True
End Sub