October 31st, 2002, 06:41 AM
Open Combo Box and DatePicker on focus event
I am developing a package and client want to open the combo box to be opened on 'setfocus' event or when cursor is focused on combo or DatePicker.
Please help me as soon as possible
Last edited by vikaspa; October 31st, 2002 at 06:45 AM.
October 31st, 2002, 02:38 PM
Send the control a CB_SHOWDROPDOWN message using SendMessage and set wParam = 1 to drop the list (wParam = 0 will close the list), something like this:
Hope this helps!
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const CB_SHOWDROPDOWN = 335
Private Sub Combo1_GotFocus()
Call SendMessage(Combo1.hWnd, CB_SHOWDROPDOWN, 1, 0)