Hello,
I was wondering how i can set focus on a other control
Yes i know with
Setfocus(a control)
But seems not working
I set this on my TextInput control
Reset(Self);;Reset(Gallery2);;Set(var_Gallery2;false);;Reset(Timer_Search)
the timer on start and autostart
OnTimerStart
Set(var_Gallery2;false)
OnTimerEnd
Reset(Gallery2);;
Set(var_Gallery2;true);;
SetFocus(Button1)
OnAutoStart
If(CountRows(Gallery2.AllItems)>0;true;false)
But focus isn't working
I have my button and other controls
In screen2
So the Gallery is in a other container
Just like the Button1, the timer is on the screen 2
Any help please
Thank you
Since setting the focus is all about input it makes sense that you can't set focus to a control that can't be seen or that is read only. Glad you solved the issue.
Hi @Pstork1
Guess it's my fault 🙄
The button1 can't be hidden if you want to add the focus
I added a new button at the same location of the timer as you provided
And that worked.
Thank you.
So we known that for in the future 😉
If you temporarily add a button to the same container as the timer and set it to SetFocus(Button1) does the focus go where you want it to when you press the button? If yes, then its something in the timer code, if no, then its something about the setFocus(). As long as the containers are on the same screen it shouldn't matter.
Two other thoughts:
1) Did you check the container to make sure that EnableChildFocus is set to True
2) Button1 is just in a container and not in a gallery correct?
Hi @Pstork1
Whoops, my fault
I forgot the code of the autostart
If(CountRows(Gallery2.AllItems)>0;true;false)
So when i type something in my TextInput control
And it match some data on the hidden gallery
the Autostart of the timer will run
It looks like the timer autostart is set to false initially, so what event starts the timer? From the code you've shown I don't think the timer ever runs, so the SetFocus never executes.