Friday, November 28, 2008

How to show-hide a combo drop down list on VB

Public Declare Function SendMessageLong Lib _
"user32" Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long

Public Const CB_SHOWDROPDOWN = &H14F
Sub Form_Load()
Combo1.AddItem "Item 1"
Combo1.AddItem "Item 2"
Combo1.AddItem "Item 3"
End Sub

Private Sub Command1_Click()
Dim r as Long
r = SendMessageLong(Combo1.hWnd, CB_SHOWDROPDOWN, True, 0)
End Sub

Private Sub Command2_Click()
Dim r as Long
r = SendMessageLong(Combo1.hWnd, CB_SHOWDROPDOWN, False, 0)
End Sub

Seja o primeiro a comentar

Post a Comment

Latest Comments

About Me

My photo
Makassar, Sulawesi Selatan, Indonesia

Guest Book


ShoutMix chat widget

Script Sense ©Template Blogger Green by Dicas Blogger.

TOPO