is there a way to return the current object that has the focus? for example when the user hits F1, it says what the current control/object they are in is?
thanks,
Thai
Printable View
is there a way to return the current object that has the focus? for example when the user hits F1, it says what the current control/object they are in is?
thanks,
Thai
Set the form.keypreview=true, then insert this to your form:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 112 Then MsgBox Me.ActiveControl.Name
End Sub
Hope it works!
You can also use the api call GetFocus(). It returns a handle to the control that is currently in focus. You can use other api calls to get the name.