I'm trying to track which Switch was switched before it was changed.
In the GotFocus event, I want to get the element number in the variable.
But gotfocus event doesn't work for Switch
LostFocus also does not work when switching to another element
Please help me figure this out.
Thank you for your quick response. Maybe you know how to distinguish who changed the state of Switch.chenged user or program. I was thinking of using GotFocus for this.
@TIMAI2 i want to follow your idea of setting up a variable, but how can i do that while i only have the .changed event? my switch can be changed automatically, but can also be triggered by a person when they click on it.. i wish there was something like a .clicked event.
The Changed() event can only be triggered by the user.
If an event occurred, the user clicked the switch.
This can be tracked in the global variable. (true/false)
About events in another element, change the states of all the others to false, and for the current element to true.
The above is not correct. Of course you can program the switch. In the below example i have used a button for demonstration purposes, but any other method, based upon some condition in the blocks can be used in the same way.
Yes, that's right. I was wrong.
Make your own global variable for each switch.
Make sure that it is always "true":
When calling "Changed()" in the program, change the corresponding one to "false" before "Changed()" then again to "true".
And in the "Changed()" event, monitor its status.
If "true" - the user clicked "click", if "false" the call is programmatic.