Jump to content
Sign in to follow this  

[Resolved] Read button ID

Recommended Posts


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. :x


#include <GUIConstantsEx.au3>

#Include <Array.au3>

$optbar = IniReadSectionNames("index.ini")

If Not IsArray($optbar) Then Exit


$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])


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)




GUICtrlCreateTabItem(""); end tabitem definition


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)




Edited by fxg4758

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.