Android Question Enabling multiple Edittext's at the same time

BenF

Member
Licensed User
Longtime User
Hi folks,
First time poster, still learning the ropes a little.

I am just wondering if there is any way to enable multiple elements (say, edittext's) at the same time (maybe have them in a group and just call Edittext_Group.Enabled = True).

I have a panel with 15 edittexts, and 5 labels, some or all of which are disabled or enabled, depending upon input. I'd rather not have to repeat
B4X:
Txt_x.Enabled = True
or
B4X:
Lbl_x.Enabled = True
up to 20 times whenever the panel is accessed.

Cheers for any help!
Ben.
 

DonManfred

Expert
Licensed User
Longtime User
B4X:
Dim btnlist As List
btnlist.add(button1)
btnlist.add(button2)
btnlist.add(button3)
btnlist.add(button4)
btnlist.add(button5)
btnlist.add(button6)
btnlist.add(button7)
btnlist.add(button8)
btnlist.add(button9)
btnlist.add(button10)
btnlist.add(button11)
btnlist.add(button12)
btnlist.add(button13)
btnlist.add(button14)
btnlist.add(button15)
btnlist.add(button16)
btnlist.add(button17)
btnlist.add(button18)
btnlist.add(button19)
btnlist.add(button20)
'
'
For i = 0 To btnlist.Size-1
   Dim btn As Button = btnlist.Get(i)
   btn.Enabled = False
Next
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…