Page 1 of 1

Redirecting focus away from a field

Posted: Fri Mar 01, 2019 9:32 pm
by see3d
I feel like a newbie again after 10 years away from LC...lol
I have a field that has the focus. When I click on some button, I want to close the field (remove the focus). I am having a hard time figuring out how to do this other than manually clicking into another field. None of my experiments have worked and a search here did not turn up anything. I must be missing something so basic that it is too obvious to be mentioned. :?

Re: Redirecting focus away from a field

Posted: Fri Mar 01, 2019 10:01 pm
by bogs
In the button's script, either in mouseDown or up, wouldn't

Code: Select all

focus on nothing
work? Or

Code: Select all

focus on {control}

Re: Redirecting focus away from a field

Posted: Fri Mar 01, 2019 10:14 pm
by [-hh]
in the button's script add the line

Code: Select all

select empty

Re: Redirecting focus away from a field

Posted: Fri Mar 01, 2019 10:22 pm
by see3d
bogs wrote:
Fri Mar 01, 2019 10:01 pm
In the button's script, either in mouseDown or up, wouldn't

Code: Select all

focus on nothing
Thank you. There you go, see I am a newbie all over again. I could not find that focus on command when I looked before (I can find it easy now). My eyes must be getting old... :shock:

Re: Redirecting focus away from a field

Posted: Fri Mar 01, 2019 10:59 pm
by bogs
see3d wrote:
Fri Mar 01, 2019 10:22 pm
Thank you. There you go, see I am a newbie all over again. I could not find that focus on command when I looked before (I can find it easy now). My eyes must be getting old...
Heh, I feel like that just about every day, believe me your more than welcome any time 2 of my brain cells fire to the beneficial side :D