CodeItBetter Programming Another VB Programming Blog

How to Show/Hide ComboBox’s DropDown List

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'Controls - How to Show/Hide ComboBox's DropDown List

Option Explicit
 
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
Private Const CB_SHOWDROPDOWN = &H14F
 
Public Sub DropList(WhichCombo As Control, DropItDown As Boolean)
    On Error Resume Next
    Dim vTmpLng As Long
    vTmpLng = SendMessage(WhichCombo.hwnd, CB_SHOWDROPDOWN, ByVal Abs(CLng(DropItDown)), ByVal CLng(0))
End Sub
 
'How can I call this sub-routine:
Private Sub Command1_Click()
    Call DropList(Combo1, True)
End Sub
Filed under: Controls Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.