Newb Posted March 9, 2011 Posted March 9, 2011 This is the code of combo box and the related values #Include <GuiComboBoxEx.au3> Global $ComboTrain = GUICtrlCreateCombo("", 104, 208, 65, 25,0x3) GuiCtrlSetData(-1,"25%|50%|75%|100%","100%") _GUICtrlComboBoxEx_SetItemParam($ComboTrain,0,25) _GUICtrlComboBoxEx_SetItemParam($ComboTrain,1,50) _GUICtrlComboBoxEx_SetItemParam($ComboTrain,2,75) _GUICtrlComboBoxEx_SetItemParam($ComboTrain,3,100) and this is the code for retrieving the data: MsgBox(0,"oo",_GUICtrlComboBox_GetCurSel($ComboTrain)) MsgBox(0,"oo",_GUICtrlComboBoxEx_GetItemParam($ComboTrain,2)) MsgBox(0,"oo",_GUICtrlComboBoxEx_GetItemParam($ComboTrain,_GUICtrlComboBox_GetCurSel($ComboTrain))) Resulting message boxes should show the following: 3 75 100 Right? but instead it shows me the following: 3 0 0 Why? I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.
Moderators Melba23 Posted March 9, 2011 Moderators Posted March 9, 2011 Newb,Often the UDF functions require you to use a control created by the UDF rather then the native AutoIt function.Try creating the combo with _GUICtrlComboBoxEx_Create as in the example for _GUICtrlComboBoxEx_GetItemParam. 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
Newb Posted March 15, 2011 Author Posted March 15, 2011 Newb, Often the UDF functions require you to use a control created by the UDF rather then the native AutoIt function. Try creating the combo with _GUICtrlComboBoxEx_Create as in the example for _GUICtrlComboBoxEx_GetItemParam. M23 The horror! I tried your advice as i got what you did mean with creating controls created by udf, but: My combo box has to be created in a GUICtrlCreateTabItem("Player Info") element. So basically it's going to be created into a tab. So, at first a did this _GUICtrlComboBox_Create($MainGUI, "", 88, 177, 113, 25,0x3) And the Combo Box Drawing was assigned to main gui and the combo box appeared over the tab items Then i realized i had to assign to the Tab Item a variable and draw the combo box over that and the code became: $TabInfo=GUICtrlCreateTabItem("Player Info") _GUICtrlComboBox_Create($TabInfo, "", 88, 177, 113, 25,0x3 But... the Combo Boxes disappeared at all.... Example code of my boxes Global $ComboTrainN =_GUICtrlComboBox_Create($TabB, "", 104, 208, 65, 25,0x3) _GUICtrlComboBox_BeginUpdate($Tab) _GUICtrlComboBox_AddString($Tab, "Alt") _GUICtrlComboBox_AddString($Tab, "Name") _GUICtrlComboBox_AddString($Tab, "Surname") _GUICtrlComboBox_AddString($Tab, "Address") _GUICtrlComboBox_EndUpdate($Tab) _GUICtrlComboBoxEx_SetItemParam($ComboTrainN,0,25) _GUICtrlComboBoxEx_SetItemParam($ComboTrainN,1,50) _GUICtrlComboBoxEx_SetItemParam($ComboTrainN,2,75) _GUICtrlComboBoxEx_SetItemParam($ComboTrainN,3,100) But the outcome is a non drawed Combo box and an empty tab... Should i recur to other methods (i have in mind some) or this is possible without big troubles? I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.
Moderators Melba23 Posted March 15, 2011 Moderators Posted March 15, 2011 Newb,If you want to use non-native controls with tabs, I strongly recommend the Tabs tutorial in the Wiki - it will show you exactly how to get UDF-created controls to work happily with tabs. If you still have problems, post a short version of your script with just the tabs and the combos and I will take a look. 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
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