wzingel Posted August 13, 2004 Share Posted August 13, 2004 I'm new to the GUI functions... but like them! I would like to create a COMBO box but want to take away the ability to type in the box, only pick from the list. Been looking for a while, and can't figure it out. Any help? $StartDay=GUISetControl("Combo","",150,10,100,80) GUISetControlData($StartDay,"Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday","Monday") Cheers Link to comment Share on other sites More sharing options...
Valik Posted August 13, 2004 Share Posted August 13, 2004 The style is called CBS_DROPDOWNLIST, but I don't know if it's in GuiConstants or what it's defined as. It causes the edit control to be replaced by a label. Link to comment Share on other sites More sharing options...
Josbe Posted August 13, 2004 Share Posted August 13, 2004 (edited) Ok, you need add to your COMBOBOX: $ES_READONLY + $CBS_DROPDOWNLIST values(constants).Look the small example...Global $CBS_DROPDOWNLIST= 3 Global $ES_READONLY= 2048 Global $LBS_STANDARD= 10485763 $myWin= "ComboTest" GUICreate($myWin, 200, 100) $StartDay=GUISetControl("Combo","", 10, 10, 100, 80, $ES_READONLY + $CBS_DROPDOWNLIST + $LBS_STANDARD) GUISetControlData($StartDay,"Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|jhj2|5|4|dsdsds|dsdsd", "Monday") GUIShow() While WinExists($myWin) Sleep(100) $msg= GUIMsg(0) If $msg = -3 Then Exit Wend ExitEDIT: Script edited Edited August 13, 2004 by josbe AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
wzingel Posted August 13, 2004 Author Share Posted August 13, 2004 (edited) Cheers Valik, I have tried that style, and it does make the combo box one that can't be typed in, but the drop down list loses it's scrollbar. I _could_ extend the size of the drop down to see all the options, but I wondered if you can keep the scroll bar AND have the box so it can't be typed in? Edited August 13, 2004 by wzingel Link to comment Share on other sites More sharing options...
wzingel Posted August 13, 2004 Author Share Posted August 13, 2004 (edited) josbe, also cheers, just checked that out, but same thing occurs, I lose the scroll bar... any ideas? Edited August 13, 2004 by wzingel Link to comment Share on other sites More sharing options...
Josbe Posted August 13, 2004 Share Posted August 13, 2004 (edited) josbe, also cheers, just checked that out, but same thing occurs, I lose the scroll bar... any ideas? <{POST_SNAPBACK}>uppps!! Add this, too: Global $LBS_STANDARD= 10485763 Edited August 13, 2004 by josbe AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
Valik Posted August 13, 2004 Share Posted August 13, 2004 You are overriding the default styles. You'll have to explicitly add all the styles you want, including WS_VSCROLL and any others you wish to have. Link to comment Share on other sites More sharing options...
wzingel Posted August 13, 2004 Author Share Posted August 13, 2004 Cheers Guys... great stuff... josbe, added that in and it works a treat, but how did you work out what numbers you are assigning to these variables? josbe & Valik, I had been looking at the GUI Control Styles in the help, and BITOR'ing the values together, but don't really understand how to work these things out for myself. Any explaination would be great! Meanwhile, I'll continue to play... seems to be the best way to learn! Thanks both Warren Link to comment Share on other sites More sharing options...
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