Article ID: 124057
Article Last Modified on 12/9/2003
' Enter the following two lines as one, single line:
Declare Function SendMessage Lib "User" (ByVal hWnd As Integer,
ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
‘For Windows 95 and 98
Const WM_USER = &H400
Const CB_SHOWDROPDOWN = (WM_USER + 15)
‘For Windows NT, 2000 and XP, define CB_SHOWDROPDOWN as below
‘Const CB_SHOWDROPDOWN = &H14F
Sub Form_Load ()
combo1.AddItem "item# 1"
combo1.AddItem "item# 2"
combo1.AddItem "item# 3"
combo1.AddItem "item# 4"
End Sub
Sub Command1_Click ()
x% = SendMessage(combo1.hWnd, CB_SHOWDROPDOWN, 1, 0&)
End Sub
Sub Command2_Click ()
x% = SendMessage(combo1.hWnd, CB_SHOWDROPDOWN, 0, 0&)
End Sub
Sub Form_Paint ()
x% = SendMessage(combo1.hWnd, CB_SHOWDROPDOWN, 0, 0&)
End Sub
Sub Form_Resize ()
x% = SendMessage(combo1.hWnd, CB_SHOWDROPDOWN, 0, 0&)
End Sub
Additional query words: 2.00 3.00 ComboBox
Keywords: KB124057