iOS Question Switch - Change value from code to designer

Angelo Maradini

Member
Licensed User
Longtime User
Hello,
I'm using a switch in B4i and I need to change his value from false to true in the code.
I write
switch.value = true
I don't receive an error, his value change in the code, but in the designer it remains false.
what can I do?
 

DonManfred

Expert
Licensed User
Longtime User
I don't receive an error, his value change in the code, but in the designer it remains false.
This is expected. You can set the defaultvalue in designer which became active when you load the layout.

Changing properties in code does not change any Layout or properties set in the designer.
This is true for B4I, B4A, B4J and probably B4R too.
 
Upvote 0

Angelo Maradini

Member
Licensed User
Longtime User
I try to explain my situation:
I have 1000 rows that start with a switch
I have a button called "SELECT ALL"
when I click on the button, I want all switch become true.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Create a sub that iterate through all 1000 rows and set the switch value for them.

This may give you some inspiration....

 
Upvote 0
Top