johnnybravo Posted July 6, 2010 Share Posted July 6, 2010 (edited) Hello all, I have a question: I am trying to read if an radio button is selected through an .ini file Below are some code snippets Radio_2 = GUICtrlCreateRadio(" ", 180,115) If FileExists($iniPath) Then $viewRadio = IniRead($iniPath, "colors", "radio", "Not Found") ;MsgBox(4096, "Result", $viewRadio, "Not found") GUICtrlSetState($viewRadio , $GUI_CHECKED) EndIf The .ini file looks like this : [colors] radio=$radio_2 I can read the value when i use the MsgBox but when i use the GUICtrlSetState the radio is not selected when i run the program. Maybe i am doing something wrong here, but i can't figure out what... Cheers, johnnyBravo Edited July 6, 2010 by johnnybravo Link to comment Share on other sites More sharing options...
johnnybravo Posted July 6, 2010 Author Share Posted July 6, 2010 (edited) I just solved the problem myself. (for the first time ) Before i used the code below to save the radio state: If GUICtrlRead($radio_2) = 1 Then IniWrite($iniPath, "colors", "radio", "$radio_2") And changed it to: If GUICtrlRead($radio_2) = 1 Then IniWrite($iniPath, "colors", "radio", $radio_2) The only thing i had to do was removing the "" around $radio_2 , Hope it could be usefull for some of you guys that are facing the same problem.. Edited July 6, 2010 by johnnybravo 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