[Gambas-user] Enabling multiple TextBoxes with ComboBox

LinuxSeeker linuxseeker at ...626...
Sat Jun 24 18:51:54 CEST 2006


I have a form (form1) with one ComboBox (containing the numbers from 1 to
10) and ten TextBoxes. I want when a user clicks on a number 'N' (where N= a
number contained in the ComboBox) in the textbox the first N TextBoxes in
the form to be activated and have "15" as their content. My code is the
following but it doesn't seem to work:

PUBLIC SUB ComboBox1_Click()

DIM i AS Integer
'disable all
FOR i = 1 TO 10 STEP 1
WITH (TextBox\i)
.enabled=FALSE
END WITH
NEXT
'enable all
FOR i = 1 TO N STEP 1
WITH (TextBox\i)
.enabled=TRUE
END WITH
NEXT

END


I also tried the following but it failed as well:

PUBLIC SUB ComboBox1_Click()

DIM i AS Integer
'disable all
FOR i = 1 TO 10 STEP 1
(TextBox,i).enabled=FALSE
NEXT
'enable the first N
FOR i = 1 TO N STEP 1
(TextBox,i).enabled=TRUE
NEXT

END

Any suggestions?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20060624/19499167/attachment.html>


More information about the User mailing list