Sign in to follow this  
Followers 0
vladedoty

how do i add a scrollbar to my combobox?

2 posts in this topic

how do i add a scrollbar to my combobox?

when i click the drop down it just drop all the items down.

i would like it to have a scrollbar so it just shows like 5 items and then if u want to see the rest u can use the scroll bar.

how do i do this?

Share this post


Link to post
Share on other sites



It's the $ws_vscroll style that will give you what you want.

#include <GUIConstantsEx.au3>
#include <ComboConstants.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Local $msg
    GUICreate("My GUI combo")  ; will create a dialog box that when displayed is centered

    GUICtrlCreateCombo("", 10, 10, -1, -1, $CBS_DROPDOWNLIST + $WS_VSCROLL) ; create first item
    GUICtrlSetData(-1, "item1|item2|item3|item4|item5|item6|item7|item8|item9|item10" & _
        "|item11|item12|item13|item14|item15|item16|item1|item2|item3|item4|item5|item6" & _
        "|item7|item8|item9|item10|item11|item12|item13|item14|item15|item16", "item3") ; add other item snd set a new default

    GUISetState()

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()

        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
EndFunc   ;==>Example

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0