#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    Mumbai
    Posts
    108
    Rep Power
    12

    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


    Wioth regards
    Vikas AThavale
    Last edited by vikaspa; October 31st, 2002 at 06:45 AM.
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,607
    Rep Power
    4247
    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:
    Code:
    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)
    End Sub
    Hope this helps!

IMN logo majestic logo threadwatch logo seochat tools logo