fxg4758 Posted December 14, 2010 Share Posted December 14, 2010 (edited) Hi. Can someone help me correct this code the read the correct button ID. In this code, i can read only the ID of buttons in the last tab. Regards! #include <GUIConstantsEx.au3> #Include <Array.au3> $optbar = IniReadSectionNames("index.ini") If Not IsArray($optbar) Then Exit _ArraySort($optbar) $hGUI = GUICreate('Ini GUI', 600,600,10,10) $varTab = GUICtrlCreateTab(10, 10, 200, 100) For $z = 1 To UBound($optbar) - 1 $optbarAreas = IniReadSectionNames($optbar[$z]) _ArraySort($optbarAreas) Local $varTabItem[uBound($optbarAreas) - 1], $Button[uBound($optbarAreas) - 1] $varTabItem[$z - 1] = GUICtrlCreateTabItem(StringTrimRight($optbar[$z],4)) For $x = 1 To UBound($optbarAreas) - 1 $var = IniReadSection($optbar[$z],$optbarAreas[$x]) If @error Then ContinueLoop $X_Coord = 10 + (($x - 1) * 180) $Button[$x - 1] = GUICtrlCreateButton($optbarAreas[$x], $X_Coord, 30, 150, 30) Next GUISetState() Next GUICtrlCreateTabItem(""); end tabitem definition GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() If $Msg = $GUI_EVENT_CLOSE Then Exit For $i = 0 To UBound($Button) - 1 If $Msg = $Button[$i] Then MsgBox(0, '$Msg = ' & $Msg, GuiCtrlRead($Button[$i]) & ' Pressed', 2) EndIf Next WEnd Edited December 14, 2010 by fxg4758 Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted December 14, 2010 Share Posted December 14, 2010 But you only put the last buttons in the array. What do you expect to happen then? Have you really thought this over? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface 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