|
В этом примере вам понадобятся два элемента CommandButton Private Const CB_SHOWDROPDOWN = &H14F
Private Declare Function SendMessageByNum Lib "user32" Alias
"SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long,
ByVal lParam As Long) As Long
Public Sub SetComboDropDown(cboCombo As ComboBox, ByVal bDown As Boolean)
Dim nRet As Long
nRet = SendMessageByNum(cboCombo.hwnd, CB_SHOWDROPDOWN, bDown, 0)
End Sub
Private Sub Command1_Click()
Call SetComboDropDown(Combo1, True)
End Sub
Private Sub Command2_Click()
Call SetComboDropDown(Combo1, False)
End Sub
Private Sub Form_Load()
Combo1.AddItem "1"
Combo1.AddItem "2"
Combo1.AddItem "3"
End Sub
|
|