WhyTea Posted September 22, 2009 Posted September 22, 2009 Is it possible to disable editing in a ComboBox while still allowing selection from the dropdown list? I.E. I would like the items in the ComboBox to be static. /Why Tea
Yashied Posted September 22, 2009 Posted September 22, 2009 Is it possible to disable editing in a ComboBox while still allowing selection from the dropdown list? I.E. I would like the items in the ComboBox to be static./Why TeaLook at $CBS_DROPDOWNLIST style. LukeLe 1 My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
Mat Posted September 22, 2009 Posted September 22, 2009 Yes!! The editing is the default style, so to change it just set the style to: $CBS_DROPDOWNLIST (requires #include<ComboConstants.au3>), or 0x0003. #include<ComboConstants.au3> $hGUI = GUICreate ("Testing combo box") GUICtrlCreateCombo ("", 2, 2, 100, 20, $CBS_DROPDOWNLIST) GUICtrlSetData (-1, "Item 1|Item 2|Item 3", "Item 1") GUISetState () While GUIGetMsg () <> -3 WEnd Mat Skysnake 1 AutoIt Project Listing
WhyTea Posted September 24, 2009 Author Posted September 24, 2009 Thanks. Got it to work now. /Why Tea
Moist Posted November 27, 2018 Posted November 27, 2018 (edited) On 22/09/2009 at 1:57 PM, Mat said: Yes!! The editing is the default style, so to change it just set the style to: $CBS_DROPDOWNLIST (requires #include<ComboConstants.au3>), or 0x0003. #include<ComboConstants.au3> $hGUI = GUICreate ("Testing combo box") GUICtrlCreateCombo ("", 2, 2, 100, 20, $CBS_DROPDOWNLIST) GUICtrlSetData (-1, "Item 1|Item 2|Item 3", "Item 1") GUISetState () While GUIGetMsg () <> -3 WEnd Mat Hi, I know this is an almost 10 year old thread but my question is relevant to this topic. When I use $CBS_DROPDOWNLIST, If my combo has a lot of elements, it won't scroll through them all. it only shows the ones that fit the height value. Is there anything else I can add to this to have both scroll and entries disabled? I've looked in the GUI Control Styles but found nothing. EDIT: Nevermind, found it. GUICtrlCreateCombo( "Combo", 45, 30, 400, 100, BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL)) Edited November 27, 2018 by Moist
Zedna Posted November 27, 2018 Posted November 27, 2018 Technically the most correct is to use $GUI_SS_DEFAULT_COMBO style as noted in Helpfile for GUICtrlCreateCombo(). So instead of GUICtrlCreateCombo ("", 2, 2, 100, 20, $CBS_DROPDOWNLIST) You should use GUICtrlCreateCombo ("", 2, 2, 100, 20, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST)) and in this case there will be also vertical scrollbar which is included in $GUI_SS_DEFAULT_COMBO (among other default styles) maniootek 1 Resources UDF ResourcesEx UDF AutoIt Forum Search
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now