LostFocus

I have a number if text fields that I have highlighting on GotFocus and I need to remove it on LostFocus.
It works great as long as you are hitting enter, tab or clicking on another text field.

The problem is I have a few buttons that open other screens and LostFocus is not being triggered
if user clicks the button. It also is not called if they select a menu item.

Why doesn’t click on another object, like a button, not trigger LostFocus on currently selected text field?
How can I make it lose focus? I dont think I can call LostFocus on every text field manually… ??? nor would that be efficient in code.

[quote] have a few buttons that open other screens and LostFocus is not being triggered
if user clicks the button[/quote]
I assume Mac, because buttons do not receive focus in Mac platform and, thus, your text field has not lost the focus by clicking the button. I would guess you will need to set the TExtField to its unfocused state when any of the buttons are clicked.
self.clearfocus should do the trick.

[quote=131770:@Tim Turner]Why doesn’t click on another object, like a button, not trigger LostFocus on currently selected text field?
How can I make it lose focus? I dont think I can call LostFocus on every text field manually… ??? nor would that be efficient in code.[/quote]

Clicking a button should place the focus on it, effectively removing it from the TextField. Difficult to know what is going on.

You can change the focus yourself by using control.setfocus or even remove all focus from controls with ClearFocus. For instance, you can start the Action event of your button by Me.Setfocus. In all these cases, the LostFocus will fire in the TextField.

Thanks guys… this is what I needed. Just what the doctor ordered.