Jump to content

Recommended Posts

Posted

Gurus,

I have a GUI with 100 odd buttons I have created. I need to loop through each one and query the Text on it.

Pseudocode:

For each button on my GUI

;do stuff

Next

Thanks in advance.

Posted (edited)

I have a GUI with 100 odd buttons I have created. I need to loop through each one and query the Text on it.

I hope you have the button ID's in an array?

If not, put them in there. If the buttons could be auto-created that would be very easy.

Dim $array[100]
For $i = 0 To 99
    $array[$i] = GUICtrlCreateButton("Text", 10, $i * 20, 50, 20)
Next

Then check with:

For $i = 0 To 99
    If GUICtrlRead($array[$i]) = "Text you want to check on" Then
         'do stuff'
    EndIf
Next
Edited by Triblade

My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

Posted

That'll do it. I'd thought I'd be lazy and avoid that way. But... this way is quicker later on. Ta triblade.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...