Jump to content
Sign in to follow this  
Paulie

Readonly ComboBox

Recommended Posts

Paulie

I've tried all I can think of, but i can't figure out how to make a combobox Readonly

Such that you must select an item from the list, and aren't able to type items manually.

I tried using "$ES_READONLY" but as expected, it didn't work.

Help plz :)

ty

Share this post


Link to post
Share on other sites
Xandl

Hello,

try to set the combobox style to $CBS_DROPDOWNLIST.

ciao

Xandl

Share this post


Link to post
Share on other sites
BrettF

#include <GUIConstantsEx.au3>
#include <ComboConstants.au3> 
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 233, 57, 193, 125)
$Combo1 = GUICtrlCreateCombo("Parts", 8, 8, 217, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData (-1, "Parts 1|Parts 2|Parts 3")
$Label1 = GUICtrlCreateLabel("Label1", 8, 32, 220, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Combo1
            GUICtrlSetData ($Label1, "You have selected '" &GUICtrlRead ($Combo1)&"'")
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites
Paulie

Thank you ver ver ver much :)

Edited by Paulie

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.