|
-
Jul 10th, 2009, 09:25 AM
#1
Thread Starter
Addicted Member
[RESOLVED] ComboBox Display
How can I make a ComboBox open in a gotfocus event?
I want the list to be displayed programaticly as if the down arrow was clicked.
I am almost sure I used to do this but I can't remember what it was that I did.
Any help is appreciated.
-
Jul 10th, 2009, 09:43 AM
#2
Re: ComboBox Display
I never did understand why the ComboBox control does not have a simple method to dropdown its own list.
Anyways, use the SendMessage API
Code:
'In a Module
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const CB_SHOWDROPDOWN = &H14F
'Form
Private Sub Combo1_GotFocus()
SendMessage Combo1.hwnd, CB_SHOWDROPDOWN, 1, 0
End Sub
-
Jul 10th, 2009, 10:30 AM
#3
Thread Starter
Addicted Member
Re: ComboBox Display
Thanks, it works great. Apparently I didn't use to do this.
-
Jul 10th, 2009, 11:51 AM
#4
Re: [RESOLVED] ComboBox Display
Perhaps you used
Code:
Private Sub Combo1_GotFocus()
SendKeys "{f4}"
End Sub
-
Jul 10th, 2009, 12:21 PM
#5
Thread Starter
Addicted Member
Re: [RESOLVED] ComboBox Display
I don't recall it being the SendKeys command.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|