Rogue5099 Posted May 29, 2011 Share Posted May 29, 2011 Okay, so I have created a Combo Box and entered in the Data. How I have it setup right now: $Name = GUICtrlCreateCombo("", 95, 8, 97, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $CBS_SIMPLE)) $NameCheck = GUICtrlRead($Name) AdlibRegister("CheckComboBox", 1000) Func CheckComboBox() If $NameCheck = GUICtrlRead($Name) Then ;Skip if same Else $NameCheck = GUICtrlRead($Name) ;Load Info into GUI EndIf EndFunc ;==>CheckComboBox Without switching to OnEvent (cause I would have to switch everything on GUI to OnEvent), is there a way once the Data is selected to load the info? The way I have it right now is even when you mouse over the data in the combo box CtrlRead reads the item highlighted even though it's not selected. My projects: Inventory / Mp3 Inventory, Computer Stats Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted May 29, 2011 Share Posted May 29, 2011 Open helpfile, and go to the the example for the UDF version for how to "properly" do it (more specifically the "create" function) .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Zedna Posted May 29, 2011 Share Posted May 29, 2011 Opt("GUIOnEventMode", 1) ... $Name = GUICtrlCreateCombo("", 95, 8, 97, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $CBS_SIMPLE)) GUICtrlSetOnEvent(-1, "ComboChanged") ... Func ComboChanged() $NameCheck = GUICtrlRead($Name) ... EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Rogue5099 Posted May 29, 2011 Author Share Posted May 29, 2011 First off these remarks are not to be mean, because I am asking for help.(more specifically the "create" function)GUICtrlCreateCombo - Copy and paste anything from this that will explain running a Func after selecting from the list.Opt("GUIOnEventMode", 1)I didn't want to go to OnEvent because I would have to switch entire program to that as I stated in the first post. I know it can be done that way and I have done it that way with other programs but I don't want to add 1000 OnEvent lines to my script. My projects: Inventory / Mp3 Inventory, Computer Stats Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted May 29, 2011 Share Posted May 29, 2011 GUICtrlCreateCombo - Copy and paste anything from this that will explain running a Func after selecting from the list.I said UDF. Run the example for _GUICtrlComboBox_Create() and see how $CBN_EDITCHANGE is sent when the edit control changed. Then look on the code for how it's done.If you are unsure about GUIRegisterMsg() then there's a GUIRegisterMsg Tutorial on the wiki. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Rogue5099 Posted May 29, 2011 Author Share Posted May 29, 2011 (edited) I said UDF. Run the example for _GUICtrlComboBox_Create() and see how $CBN_EDITCHANGE is sent when the edit control changed. Then look on the code for how it's done. If you are unsure about GUIRegisterMsg() then there's a GUIRegisterMsg Tutorial on the wiki. Thank you so much for your help. I liked how you helped with a hint instead of just solving it for me that way I learn a little more. Solved it with one line: GUIRegisterMsg($CBN_SELENDOK, "CheckComboBox") Never used GUIRegisterMsg before and I would have never known where to look for the msgID, thanks again!!! Still working forgot had AdlibRegister Still on... Edited May 29, 2011 by rogue5099 My projects: Inventory / Mp3 Inventory, Computer Stats Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted May 29, 2011 Share Posted May 29, 2011 Did you look at the example? It's "WM_COMMAND" you need to register .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface 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