iOS Question Switch

moore_it

Well-Known Member
Licensed User
Hello,

please help me, how works switch ?

I try this but not work,

sub sw1_valuechanged(value as boolean)
sw1.value = value
and sub

thanks guy ...
 

klaus

Expert
Licensed User
What exactly do you want to do ?
The sw1_ValueChanged event routine is called when you click on the switch and Value returns the switch state.
If the switch is 'ON' Value = True.
If the switch is 'OFF' Value = False.
It's similar to the CheckBox in B4A.
 

moore_it

Well-Known Member
Licensed User
Hi Klaus,

in an pane ia have a switch, if is true when i click on a button go to sub a if switch is false go to sub b ....
but the switch not work in this mode it's every false (the default state)
I don't understand how it work.

thanks
 

moore_it

Well-Known Member
Licensed User
This is the view , when i click on button in right bottom, if the switch is on go to 'sub a' if it off go to 'sub b'.
But if i set switch on, when i click the button the value is always off ....

why ?
 

Attachments

moore_it

Well-Known Member
Licensed User
yes it change
i change in on state
but when i click on bottom right button ... switch value is false
 

moore_it

Well-Known Member
Licensed User
I'm so very sorry, i resolved my problem, it's a my stupid error !
Sorry again

Toni
 

klaus

Expert
Licensed User
In such cases it might be interesting to make a smaller project showing the problem.
And sometimes, the small one works OK and allows to find the problem (personal experience).
 

tcgoh

Active Member
Licensed User
Is it possible to set the Switch Size? or add a text on the switch like "ON"/"OFF", "I/O"
 
Top