This example automatically drops down the list portion of a ComboBox control whenever the ComboBox receives the focus. To try this example, create a new form containing a ComboBox control and an OptionButton control (used only to receive the focus). Create a new module using the Add Module command on the Project menu. Paste the Declare statement into the Declarations section of the new module, being sure that the statement is on one line with no break or wordwrap. Then paste the Sub procedure into the Declarations section of the form, and press F5. Use the TAB key to move the focus to and from the ComboBox.
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
Private Sub Combo1_GotFocus () Const CB_SHOWDROPDOWN = &H14F Dim Tmp Tmp = SendMessage(Combo1.hWnd, CB_SHOWDROPDOWN, 1, ByVal 0&) End Sub
Ja, det så jeg godt, men kunne bare ikke selv finde det :-)
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.