Zobrazenφ/skrytφ polo₧ek comba

Postup:
Deklarujte v deklaraΦnφ Φßsti formulß°e:

Private 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

Private Const CB_SHOWDROPDOWN = &H14F

Na formulß° p°idejte combo a dv∞ tlaΦφtka. K≤d formulß°e je nßsledujφcφ:

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

Po stisku prvnφho tlaΦφtka se automaticky combo rozbalφ a po stisku druhΘho zase zmizφ.

Zp∞t

Autor: The Bozena