Jump to content
Sign in to follow this  

Make combo not editable but able to select?

Recommended Posts

I checked the styles and its not there, you would think this would be important wouldnt you? In this case it lists all the open, visible, active windows and an option "Any"... Rather than make it change back to the text field (where your supposed to type) I keep it there so that you can scroll with your mouse button. But if I werent a mouse-scroller type of person I would click it... but then if I type again it erases it and starts typing a new one. I DONT WANT THIS! How can I lock the box while keeping it able to change by the user?

Share this post

Link to post
Share on other sites

Case $tempcombo <> GUICtrlRead($Combo)
            $temp = 1
            For $i = 0 to UBound($Previews)-1
                If GUICtrlRead($Combo) = $Previews[$i] Then $Temp = 0
            If GUICtrlRead($Combo) = "Any" Then $Temp = 0
            If $temp = 1 Then 
                $Temp = 0
            $tempcombo = GUICtrlRead($Combo)

That seems to work, whenever you change it, it changes back to what it was... unless its one of the Previews or "any"

works perfectly :P

But I still think there should be a style for this...

Share this post

Link to post
Share on other sites

Using the style $CBS_DROPDOWNLIST for your combo might be a little bit easier :

#include <GUIConstants.au3>

GUICreate("My GUI combo")  ; will create a dialog box that when displayed is centered

GUICtrlCreateCombo ("item1", 10,10, 200, 100, $CBS_DROPDOWNLIST) ; create first item
GUICtrlSetData(-1,"item2|item3","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

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...