Queener Posted January 28, 2016 Share Posted January 28, 2016 (edited) I know for a fact that the combobox and read ini sections name is correct and worked fine, but I'm not able to get it to display the information in combobox with a radio select. So the goal is; if I select a radio 1 then it populate a list of items. As soon as I select the new radio then it populate another set of different items. How do I go about doing that? I tried: If GUICtrlRead($itemlist1, $GUI_CHECKED) Then For $i = 1 To $sections1[0] $newvalue = $newvalue & $sections1[$i] & "|" Next GUICtrlSetData($inputinvitems, StringTrimRight($newvalue, 1)) GUICtrlSetData($inputcreitems, StringTrimRight($newvalue, 1)) ElseIf GUICtrlRead($itemlist2, $GUI_CHECKED) Then For $i = 1 To $sections1[0] $newvalue = $newvalue & $sections1[$i] & "|" Next GUICtrlSetData($inputinvitems, StringTrimRight($newvalue, 1)) GUICtrlSetData($inputcreitems, StringTrimRight($newvalue, 1)) I also tried if guictrlread combobox = 1 then. My guess would be that I would need a button to control the information being display? Edited January 28, 2016 by Queener Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 28, 2016 Moderators Share Posted January 28, 2016 Queener, I would do something like this: expandcollapse popup#include <GUIConstantsEx.au3> Global $aData[10] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] $hGUI = GUICreate("Test", 500, 500) GUIStartGroup() $cRad_1 = GUICtrlCreateRadio(" Items 1-4", 10, 10, 200, 20) $cRad_2 = GUICtrlCreateRadio(" Items 5-9", 10, 50, 200, 20) $cCombo = GUICtrlCreateCombo("", 10, 100, 200, 20) GUISetState() While 1 Local $iStart = -1, $iEnd = -1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cRad_1, $cRad_2 $sData = "" If GUICtrlRead($cRad_1) = $GUI_CHECKED Then $iStart = 0 $iEnd = 4 Else $iStart = 5 $iEnd = 9 EndIf For $i = $iStart To $iEnd $sData &= "|" & $aData[$i] Next GUICtrlSetData($cCombo, $sData) EndSwitch WEnd Please ask if you have any questions. M23 Queener 1 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...
Queener Posted January 29, 2016 Author Share Posted January 29, 2016 (edited) when I use your example it works, but if I implement into my project; it doesn't work because the items are from an ini file. EDIT: I found my mistake... I didn't set the new value to empty so each time I select a different radio, it adds to the bottom of the list. All fixed. Edited January 29, 2016 by Queener Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") 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