Results 1 to 4 of 4

Thread: Combo box auto list

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2005
    Posts
    150

    Combo box auto list

    How do i list whatever was in the combox without clicking on the small arrow?


    I want when the user lunches the program , the drop list to be already opened?


    Help?

  2. #2
    Frenzied Member wiz126's Avatar
    Join Date
    Jul 2005
    Location
    Mars,Milky Way... Chit Chat Posts: 5,733
    Posts
    1,080

    Re: Combo box auto list

    if you want your combobx stay allways open, how about just using the listbox control?
    1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
    2) If someone has been useful to you please show your respect by rating their posts.
    3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
    4) Before posting your question, make sure you checked this links:
    MICROSOFT MSDN -- VB FORUMS SEARCH

    5)Support Classic VB - A PETITION TO MICROSOFT

    ___________________________________________________________________________________
    THINGS TO KNOW ABOUT VB: || VB Examples/Demos
    What are Classes?
    || -
    Where to place a sub/function?(global) || Webbrowser control

  3. #3
    Addicted Member Osiris's Avatar
    Join Date
    Oct 2000
    Location
    Dimension Hole
    Posts
    142

    Re: Combo box auto list

    if you don't want your combo box to always stay open here are two options:

    1. Use the Win32 API to perform a mouse click on the combo box

    2. Use SendKeys on the combo box.
    ؊Ϯϊ

  4. #4
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Combo box auto list

    Try the following:
    VB Code:
    1. Private Sub Form_Activate()
    2.     Combo1.SetFocus
    3.     SendKeys "%{DOWN}"
    4. End Sub
    5.  
    6. Private Sub Command1_Click()
    7.     MsgBox Combo1.List(Combo1.ListIndex)
    8.    
    9.     'OR (whatever works for you better)
    10.    
    11.     MsgBox Combo1.Text
    12. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width