R
Ricardo Hernández Sáez
The API function "GetFocus" return the hWnd of the form when you get
into the combobox using the mouse.
Try this:
....
Private Declare Function GetFocus Lib "user32" () As Long
....
Private Sub MyCombo_GotFocus()
Dim hWndFrm As Long
Dim hWndCb As Long
hWndFrm = Me.hWnd
hWndCb = GetFocus()
If hWndFrm <> hWndCb Then
MsgBox "Ok. I Have the hWnd of the Combo.", vbInformation
Else
MsgBox "The API function GetFocus return the hWnd of the form",
vbExclamation
End If
End Sub
Any solution or workaround??
into the combobox using the mouse.
Try this:
....
Private Declare Function GetFocus Lib "user32" () As Long
....
Private Sub MyCombo_GotFocus()
Dim hWndFrm As Long
Dim hWndCb As Long
hWndFrm = Me.hWnd
hWndCb = GetFocus()
If hWndFrm <> hWndCb Then
MsgBox "Ok. I Have the hWnd of the Combo.", vbInformation
Else
MsgBox "The API function GetFocus return the hWnd of the form",
vbExclamation
End If
End Sub
Any solution or workaround??