Avatar billede flashit Nybegynder
17. april 2004 - 23:25 Der er 3 kommentarer og
1 løsning

åben combobox

Hej E.

Jeg flytter focus med combobox1.serfocus, men kan man ikke få den til at åbne comboboxen?
Avatar billede kabbak Professor
17. april 2004 - 23:57 #1
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
Avatar billede flashit Nybegynder
18. april 2004 - 00:40 #2
Super TAK c",)
Avatar billede kabbak Professor
18. april 2004 - 00:45 #3
selv tak, det er direkte kopieret fra hjælpen. ;-))
Avatar billede flashit Nybegynder
18. april 2004 - 08:12 #4
Ja, det så jeg godt, men kunne bare ikke selv finde det :-)
Avatar billede Ny bruger Nybegynder

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.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester