[Gambas-user] Enabling multiple TextBoxes with ComboBox

Christopher Brian Jack brian at ...1334...
Sun Jun 25 13:57:01 CEST 2006


Isn't there a way to use tags and a loop?  This gets rather nasty for
larger numbers of TextBox-es (say for 20+).

> > Option 1: Do it the crude way. This does have the advantage it is very
> > simple and easy to debug.
> >
> >     DIM i AS Integer
> >     i = Val(ComboBox1.Text)
> >     TextBox1.Enabled = (i >= 1)
> >     TextBox2.Enabled = (i >= 2)
> >     TextBox3.Enabled = (i >= 3)
> >     . ..
> Thanks, my code so far has been a pile of junk just to make it work (with
> ten if's and ten commands for each if...). This will make it way more
> readable. Thanks again.

.=================================================.
|  Christopher BRIAN Jack aka "Gau of the Veldt"  |
+================================================='
| brian _AT_ brians-anime _DOT_ com
`=================================================-
Hi Spambots, my email address is sputnik at ...1334...




More information about the User mailing list