Jump to content

Recommended Posts

Posted

I want to create many radio buttons in a loop, their coordinates are not the same, but there is a pattern, I want 72 radio buttons

$Radio[0] = GUICtrlCreateRadio("", 210, 95, 15, 15)

$Radio[1] = GUICtrlCreateRadio("", 225, 90, 15, 15)

$Radio[2] = GUICtrlCreateRadio("", 240, 95, 15, 15)

$Radio[3] = GUICtrlCreateRadio("", 205, 110, 15, 15)

$Radio[4] = GUICtrlCreateRadio("", 225, 110, 15, 15)

$Radio[5] = GUICtrlCreateRadio("", 245, 110, 15, 15)

$Radio[6] = GUICtrlCreateRadio("", 210, 125, 15, 15)

$Radio[7] = GUICtrlCreateRadio("", 225, 130, 15, 15)

$Radio[8] = GUICtrlCreateRadio("", 240, 125, 15, 15)

These are the first 9 and the rest should be the same 9 only the $Radio[] should increase by one for every radio, I can do it the simple way, declare them all like this but I would prefer a for loop, I'm not calm enough at the moment to think :/

Anyone care to help?

I tought of this:

$y = 0

For $x = 0 to $x = 7

$Radio[$y+$x] = GUICtrlCreateRadio("", 210, 95, 15, 15)

$Radio[$y+$x+1] = GUICtrlCreateRadio("", 225, 90, 15, 15)

$Radio[$y+$x+2] = GUICtrlCreateRadio("", 240, 95, 15, 15)

$Radio[$y+$x+3] = GUICtrlCreateRadio("", 205, 110, 15, 15)

$Radio[$y+$x+4] = GUICtrlCreateRadio("", 225, 110, 15, 15)

$Radio[$y+$x+5] = GUICtrlCreateRadio("", 245, 110, 15, 15)

$Radio[$y+$x+6] = GUICtrlCreateRadio("", 210, 125, 15, 15)

$Radio[$y+$x+7] = GUICtrlCreateRadio("", 225, 130, 15, 15)

$Radio[$y+$x+8] = GUICtrlCreateRadio("", 240, 125, 15, 15)

$y = ($x + 1) * 9

Next

Will it work?

s!mpL3 LAN Messenger

Current version 2.9.9.1 [04/07/2019]

s!mpL3 LAN Messenger.zip

s!mpL3

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
×
×
  • Create New...