dazza Posted July 21, 2010 Share Posted July 21, 2010 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. Link to comment Share on other sites More sharing options...
Triblade Posted July 21, 2010 Share Posted July 21, 2010 (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 July 21, 2010 by Triblade My active project(s): A-maze-ing generator (generates a maze) My archived project(s): Pong3 (Multi-pinger) Link to comment Share on other sites More sharing options...
dazza Posted July 21, 2010 Author Share Posted July 21, 2010 That'll do it. I'd thought I'd be lazy and avoid that way. But... this way is quicker later on. Ta triblade. Link to comment Share on other sites More sharing options...
Triblade Posted July 21, 2010 Share Posted July 21, 2010 Np, array's FTW My active project(s): A-maze-ing generator (generates a maze) My archived project(s): Pong3 (Multi-pinger) 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