ondrovic Posted December 23, 2012 Share Posted December 23, 2012 (edited) Trying to figure out the best way to automatically create checkboxes in a gui from a .ini file. I have looked at ListView but can't seem to get it to populate correctly. Here is the code that is reading the file global $var = IniReadSection("C:\config.ini","install") If @error Then MsgBox(4096, "", "Error occurred, probably no INI file.") Else For $i = 1 To $var[0][0] If($var[$i][1] = 1) Then MsgBox(4096,"",$var[$i][0] & @CRLF,3) EndIf Next EndIf It will grab each item in the ini and display the appropriate item in a msgbox any help would be greatly appreciated Edited December 23, 2012 by ondrovic Link to comment Share on other sites More sharing options...
PhoenixXL Posted December 23, 2012 Share Posted December 23, 2012 Exampleexpandcollapse popupGlobal $var = IniReadSection(@ScriptDir & '\Configuration.ini', "install") If @error Then MsgBox(4096, "", "Error occurred, probably no INI file.") Else If UBound($var) < 2 Then Exit -1 ; For $i = 1 To $var[0][0] ;If ($var[$i][1] = 1) Then ; MsgBox(4096, "", $var[$i][0] & ' = ' & $var[$i][1]) ;EndIf ; Next EndIf ;Lets Create the GUI GUICreate(@ScriptName & ' | Phoenix XL') Local $sParam For $i = 2 To $var[0][0] $sParam &= $var[$i][1] & ',' Next ;Trim the Last Comma and Add Parenthesis $sParam = '(' & StringTrimRight($sParam, 1) & ')' ;Lets Create the Element Execute('GUICtrlCreate' & $var[1][1] & $sParam) ;Call is more appropriate but requires more code ;) GUISetState() While GUIGetMsg() <> -3 Sleep(10) WEnd #cs Configuration.ini [install] El= CheckBox Txt = "This is an Example" 1 =10 2 = 10 #ceThumbs up if it helped ondrovic 1 My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
ondrovic Posted December 23, 2012 Author Share Posted December 23, 2012 Will give it a shot and report back thanks for the assist 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