jpoteet Posted May 16, 2006 Share Posted May 16, 2006 Hi guys.... I bascially have a GUI that lets the user configure some options via radio buttons and then writes the results into an ini file. I have this part working but i cannot seem to have the GUI check the ini while opening and set the radios based on pre-existing selections. Here is some of what I have so far but it always defaults to radio1 even if the ini has radio3 selected. Below is an example of the ini and code:(1=selected 0=not) ###ini### [update] productA to productB=0 productB to productA=1 Two Way=0 [Date] All Dates=0 Today=0 30Days=1 Today Forward=0 ####### #include <GUIConstants.au3> $Form1 = GUICreate("Configuration", 405, 397, 219, 103) $Group1 = GUICtrlCreateGroup("Update", 24, 24, 353, 145) GUICtrlSetColor(-1, 0x000080) $Radio3 = GUICtrlCreateRadio("Two-way: If a field has changed in both products who will win?", 40, 104, 329, 17) $Radio2 = GUICtrlCreateRadio("One-way from productA to productB", 40, 72, 305, 25) $Radio1 = GUICtrlCreateRadio("One-way from productB to productA", 40, 48, 305, 17) $Combo1 = GUICtrlCreateCombo("", 64, 128, 105, 21) GUICtrlSetData(-1,"produtA|productB","") GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("For These Dates", 24, 184, 353, 161) GUICtrlSetColor(-1, 0x000080) $Radio4 = GUICtrlCreateRadio("All Dates", 40, 208, 305, 17) $Radio5 = GUICtrlCreateRadio("Today", 40, 240, 305, 17) $Radio6 = GUICtrlCreateRadio("30 Days from Today", 40, 304, 305, 17) $Radio7 = GUICtrlCreateRadio("Today and Forward", 40, 272, 305, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Button1 = GUICtrlCreateButton("OK", 216, 360, 73, 25) $Button2 = GUICtrlCreateButton("Cancel", 304, 360, 73, 25) If IniRead("C:\OAS\pref.ini", "Update", "productA to productB", "1") Then GUICtrlSetState ($radio1,$GUI_CHECKED) ElseIf IniRead("C:\OAS\pref.ini", "Update", "productB to productA", "1") Then GUICtrlSetState ($radio2,$GUI_CHECKED) ElseIf IniRead("C:\OAS\pref.ini", "Update", "Two Way", "1") Then GUICtrlSetState ($radio3,$GUI_CHECKED) EndIf GUISetState(@SW_SHOW) Thanks in advance...JP Link to comment Share on other sites More sharing options...
Valuater Posted May 16, 2006 Share Posted May 16, 2006 maybe #include <GUIConstants.au3> $Form1 = GUICreate("Configuration", 405, 397, 219, 103) $Group1 = GUICtrlCreateGroup("Update", 24, 24, 353, 145) GUICtrlSetColor(-1, 0x000080) $Radio3 = GUICtrlCreateRadio("Two-way: If a field has changed in both products who will win?", 40, 104, 329, 17) $Radio2 = GUICtrlCreateRadio("One-way from productA to productB", 40, 72, 305, 25) $Radio1 = GUICtrlCreateRadio("One-way from productB to productA", 40, 48, 305, 17) $Combo1 = GUICtrlCreateCombo("", 64, 128, 105, 21) GUICtrlSetData(-1,"produtA|productB","") GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("For These Dates", 24, 184, 353, 161) GUICtrlSetColor(-1, 0x000080) $Radio4 = GUICtrlCreateRadio("All Dates", 40, 208, 305, 17) $Radio5 = GUICtrlCreateRadio("Today", 40, 240, 305, 17) $Radio6 = GUICtrlCreateRadio("30 Days from Today", 40, 304, 305, 17) $Radio7 = GUICtrlCreateRadio("Today and Forward", 40, 272, 305, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Button1 = GUICtrlCreateButton("OK", 216, 360, 73, 25) $Button2 = GUICtrlCreateButton("Cancel", 304, 360, 73, 25) If IniRead("C:\OAS\pref.ini", "Update", "productA to productB", "0") = 1 Then GUICtrlSetState ($radio1,$GUI_CHECKED) ElseIf IniRead("C:\OAS\pref.ini", "Update", "productB to productA", "0") = 1 Then GUICtrlSetState ($radio2,$GUI_CHECKED) ElseIf IniRead("C:\OAS\pref.ini", "Update", "Two Way", "0") = 1 Then GUICtrlSetState ($radio3,$GUI_CHECKED) EndIf GUISetState(@SW_SHOW) 8) Link to comment Share on other sites More sharing options...
jpoteet Posted May 16, 2006 Author Share Posted May 16, 2006 Works like a champ......thank you very much.....again 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