Sign in to follow this  
Followers 0
Necromorph

GUICTRLCREATECOMBO

4 posts in this topic

Okay, this is prolly going to be an easy one for you guys, but i can't seem to figure it out

i want to make a combo box with two entries, but want those to be the only possible entrys in the control so i have this

GUICREATE("PalMate ERP AutoInstaller", 300, 350)
    GUICTRLCREATELABEL("Server/Client Installer", 25, 25)
    $installer=GUICTRLCREATECOMBO("Server", 25, 40, 250)
        GUICTRLSETDATA(-1, "Client")
    GUICTRLCREATELABEL("Comapany Name", 25, 70)
    $installname=GUICTRLCREATEINPUT("Demo", 25, 85, 250)
    GUICTRLCREATELABEL("Port Number", 25, 115)
    $installport=GUICTRLCREATEINPUT("3127", 25, 130, 250)
    GUICTRLCREATEGROUP("Database Options", 20, 160, 260, 105)
    $installopt_1=GUICTRLCREATERADIO("No Change", 25, 175)
    $installopt_2=GUICTRLCREATERADIO("Update Existing Database", 25, 195)
    $installopt_3=GUICTRLCREATERADIO("Initialize Database", 25, 215)
    $installopt_4=GUICTRLCREATERADIO("Demonstration Database", 25, 235)
    $dbbackupopt=GUICTRLCREATECHECKBOX("Backup Existing Database", 25, 270)
    $start=GUICTRLCREATEBUTTON("Next >", 125, 300, 75)
    $install_cancel=GUICTRLCREATEBUTTON("Cancel", 200, 300, 75)
    GUISETSTATE()
    GUICTRLSETSTATE($installopt_4, $GUI_CHECKED)
    GUICTRLSETSTATE($start, $GUI_DEFBUTTON)

no for the $var labeled $installer, i want only "server" or "client" to be in that box, so how do i lock it down so you can't type in it, but can still change the selections.

thanks for you help.

Share this post


Link to post
Share on other sites



redLabel,

You need the $CBS_DROPDOWNLIST style - like this: :mellow:

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

$hGUI = GUICreate("Test", 500, 500)

$installer=GUICTRLCREATECOMBO("Server", 25, 40, 250, Default, $CBS_DROPDOWNLIST)
    GUICTRLSETDATA(-1, "Client")
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
M23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Or like this:

$installer=GUICTRLCREATECOMBO("Server", 25, 40, 250, Default, BitOR($GUI_SS_DEFAULT_COMBO , $CBS_DROPDOWNLIST))

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Thanks much, works perfect.

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