Wb-FreeKill Posted May 24, 2005 Share Posted May 24, 2005 How do i make this combo read only? the user wont be able to change the data, vut to select one of the three #Include <GUIConstants.au3> GUICreate("GUI",200,200) GUICtrlCreateCombo("",40,40,90,20) GUICtrlSetdata(-1,"Minimize|Normal|Maximize","Normal") GUISetstate() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit WEnd Link to comment Share on other sites More sharing options...
Mr. Crimson Posted May 24, 2005 Share Posted May 24, 2005 I think if you put this just below your Combo line, it should grey it out: GUICtrlSetState(-1,$GUI_DISABLE) Best- Crim Link to comment Share on other sites More sharing options...
Wb-FreeKill Posted May 24, 2005 Author Share Posted May 24, 2005 I think if you put this just below your Combo line, it should grey it out:GUICtrlSetState(-1,$GUI_DISABLE)Best-Crim<{POST_SNAPBACK}>Not grey it out.. but make it READONLY.. now the user can change the data of the combo by deleteing the contents or select by scrolling down.. but i want him only to be able to scrool down, NOT change the text/data of the combo.. i know this is possible, but i don't if it is in autoit Link to comment Share on other sites More sharing options...
CyberSlug Posted May 24, 2005 Share Posted May 24, 2005 (edited) You want the CBS_ DROPDOWNLIST style which should be in GuiConstants.au3; value is 0x3 GUICtrlCreateCombo("",40,40,90,120, $CBS_DROPDOWNLIST) P.S. Remember to use a large height for combo box so that it appears correctly on Windows 2000/9x Edited May 24, 2005 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
GaryFrost Posted May 24, 2005 Share Posted May 24, 2005 $CBS_DROPDOWNLIST style SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
Wb-FreeKill Posted May 24, 2005 Author Share Posted May 24, 2005 Thank you! exactly what i needed Link to comment Share on other sites More sharing options...
JSThePatriot Posted July 19, 2005 Share Posted July 19, 2005 Okay finally found it... this post was 7 pages deep on the search. I almost posted in another topic giving up, but I finished the 7th page and here we are... Now to my question . I have tried using $CBS_DROPDOWN or $CBS_DROPDOWNLIST to make my ComboBox Read-Only, and its not working. It wont even let me select anything except when I type it in and then use the arrow buttons. Maybe I am doing something wrong. I will post the code when I get home. I would apprecaite anyone's help. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Helge Posted July 19, 2005 Share Posted July 19, 2005 You're using Windows 2000, right ?P.S. Remember to use a large height for combo box so that it appears correctly on Windows 2000/9x<{POST_SNAPBACK}>Make it a rule to always create a combobox with a height around 100px, so thatusers that don't have Windows XP don't get problems using it. That goes for all of you ! Link to comment Share on other sites More sharing options...
JSThePatriot Posted July 19, 2005 Share Posted July 19, 2005 You're using Windows 2000, right ?Make it a rule to always create a combobox with a height around 100px, so thatusers that don't have Windows XP don't get problems using it. That goes for all of you !<{POST_SNAPBACK}>Interesting. I just let it select its own height. I am on WindowsXP Home at the moment. I have tried the above code on my main computer and it works. Below is the code I am trying to get to work now.expandcollapse popup;Test>Question-Grade-Picture-Type-Sound>Answer-Correct #include <GUIConstants.au3> #NoTrayIcon Dim $wGUI, $hGUI Dim $wQUE, $wANS, $wPIC, $wSND $wGUI = 350 $hGUI = 310 $wQUE = $wGUI - 30 $wANS = ($wGUI - 40) - 38 $wPIC = ($wGUI - 123)/2 $wSND = ($wGUI - 123)/2 + 16 $hWnd = GUICreate("FCA Diagnostic Testing", $wGUI, $hGUI) $lblTest = GUICtrlCreateLabel("Test Name", 10, 10) $cmbTest = GUICtrlCreateCombo("", 15, 25, $wQUE) GUICtrlSetData($cmbTest, "Reading Decoding|Spelling|Reading Comprehension|Mathematics Computation|Mathematics Applications|Listening Comprehension", "") GUICtrlSetStyle($cmbTest, $CBS_DROPDOWNLIST) $btnHelpIns = GUICtrlCreateButton("Help/Instructions", 25, 275, 100) $btnSubmit = GUICtrlCreateButton("&Submit Question", 125, 275, 100) $btnExit = GUICtrlCreateButton("Exit", 225, 275, 100) GUICtrlSetState($btnSubmit, $GUI_DEFBUTTON) GUICtrlSetState($btnHelpIns, $GUI_DISABLE) GUISetState(@SW_SHOW, $hWnd) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE $ret = MsgBox(1, "Save?", "If you have not saved this question then please go back by pressing Cancel and press 'Submit Question'") If $ret <> 2 Then ExitLoop Case $msg = $btnExit $ret = MsgBox(1, "Save?", "If you have not saved this question then please go back by pressing Cancel and press 'Submit Question'") If $ret <> 2 Then ExitLoop EndSelect WEndIf you could help me out I would greatly appreciate it. I will try specifying the box size, as well as running the above code on this box and see if it works.JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
JSThePatriot Posted July 19, 2005 Share Posted July 19, 2005 Interesting. I just let it select its own height. I am on WindowsXP Home at the moment. I have tried the above code on my main computer and it works. Below is the code I am trying to get to work now.expandcollapse popup;Test>Question-Grade-Picture-Type-Sound>Answer-Correct #include <GUIConstants.au3> #NoTrayIcon Dim $wGUI, $hGUI Dim $wQUE, $wANS, $wPIC, $wSND $wGUI = 350 $hGUI = 310 $wQUE = $wGUI - 30 $wANS = ($wGUI - 40) - 38 $wPIC = ($wGUI - 123)/2 $wSND = ($wGUI - 123)/2 + 16 $hWnd = GUICreate("FCA Diagnostic Testing", $wGUI, $hGUI) $lblTest = GUICtrlCreateLabel("Test Name", 10, 10) $cmbTest = GUICtrlCreateCombo("", 15, 25, $wQUE) GUICtrlSetData($cmbTest, "Reading Decoding|Spelling|Reading Comprehension|Mathematics Computation|Mathematics Applications|Listening Comprehension", "") GUICtrlSetStyle($cmbTest, $CBS_DROPDOWNLIST) $btnHelpIns = GUICtrlCreateButton("Help/Instructions", 25, 275, 100) $btnSubmit = GUICtrlCreateButton("&Submit Question", 125, 275, 100) $btnExit = GUICtrlCreateButton("Exit", 225, 275, 100) GUICtrlSetState($btnSubmit, $GUI_DEFBUTTON) GUICtrlSetState($btnHelpIns, $GUI_DISABLE) GUISetState(@SW_SHOW, $hWnd) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE $ret = MsgBox(1, "Save?", "If you have not saved this question then please go back by pressing Cancel and press 'Submit Question'") If $ret <> 2 Then ExitLoop Case $msg = $btnExit $ret = MsgBox(1, "Save?", "If you have not saved this question then please go back by pressing Cancel and press 'Submit Question'") If $ret <> 2 Then ExitLoop EndSelect WEndIf you could help me out I would greatly appreciate it. I will try specifying the box size, as well as running the above code on this box and see if it works.JS<{POST_SNAPBACK}>Okay it seems you cant use the GUICtrlSetStyle to set the style of the combo box. It would be much easier if that was the case.Got it working other than that. Now I have to go back and add that style into my code throughout the program. Oh well. Atleast I got it working. I worked all night last night non stop on this program. That was just bothering me even though I got it to a point of beta release.JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
GaryFrost Posted July 19, 2005 Share Posted July 19, 2005 The GUICtrlSetStyle($cmbTest, $CBS_DROPDOWNLIST) is not working try $cmbTest = GUICtrlCreateCombo("", 15, 25, $wQUE,-1,$CBS_DROPDOWNLIST) SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
JSThePatriot Posted July 19, 2005 Share Posted July 19, 2005 The GUICtrlSetStyle($cmbTest, $CBS_DROPDOWNLIST) is not working try$cmbTest = GUICtrlCreateCombo("", 15, 25, $wQUE,-1,$CBS_DROPDOWNLIST)<{POST_SNAPBACK}>^^ TY for helping though.BTW I just wanted to pass a comment your way. You have done very good and come along way very quickly in AutoIt. Keep up the good work.JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
GaryFrost Posted July 19, 2005 Share Posted July 19, 2005 Thanks, long ways to go yet SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
JSThePatriot Posted July 20, 2005 Share Posted July 20, 2005 Thanks, long ways to go yet <{POST_SNAPBACK}>Aye we all do.So do the devs know GUICtrlSetStyle() isnt working? Or do I need to submit it as a bug?JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
GaryFrost Posted July 20, 2005 Share Posted July 20, 2005 Aye we all do.So do the devs know GUICtrlSetStyle() isnt working? Or do I need to submit it as a bug?JS<{POST_SNAPBACK}>Don't have a clue.Gary SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
UDFLover123 Posted January 14, 2013 Share Posted January 14, 2013 (edited) GUICtrlSetStyle is working with me, but you should first add#include <ComboConstants.au3>Else, the constant $CBS_DROPDOWNLIST isn't recognized, which makes the GUICtrlSetStyle raise an error.I tried with $CBS_DROPDOWNLIST and it didn't make a read-only box... I still have the problem to clock user input without blocking user selection. Do you have any idea how to solve it?Thank you for your answer! Edited January 14, 2013 by IwantaBOT Link to comment Share on other sites More sharing options...
BigDod Posted January 14, 2013 Share Posted January 14, 2013 Why bring up such an old topic Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 14, 2013 Moderators Share Posted January 14, 2013 IwantaBOT,We strongly discourage necro-posting in threads this old. I take it you did not notice that the post above yours dates from over 6 years ago? The fact that the code now shows an error is because the various *Constants.au3 include files have changed dramatically since then - which is indeed one of the reasons we discourage necro-posting. Rather then resurrect dead threads, please open a new thread next time - we do not mind at all. As to your problem - this code gives me a read-only combo:#include <GUIConstantsEx.au3> #include <ComboConstants.au3> $hGUI = GUICreate("Test", 500, 500) $cCombo = GUICtrlCreateCombo("", 10, 10, 200, 20, $CBS_DROPDOWNLIST ) GUICtrlSetData($cCombo, "|1|2|3|4|5") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndDoes it work for you? M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
UDFLover123 Posted January 18, 2013 Share Posted January 18, 2013 OOPS yeah it's quite old sry, i should be more careful with that Thank you for you answer, i realized my problem was to use $CBS_DROPDOWN and not $CBS_DROPDOWNLIST... So it works, Thanks! Link to comment Share on other sites More sharing options...
TormentoRobots Posted January 18, 2013 Share Posted January 18, 2013 I was looking all over for this in documentation, coudn't find anything thank you was a question I had a few weeks ago #Include-once;TormentoRobots Link to comment Share on other sites More sharing options...
Recommended Posts