LoseFocus

Description

Occurs just before a control loses focus (after it becomes inactive).

PowerBuilder event information

Event ID: pbm_dwnkillfocus

Return Values

There are no special outcomes for this event. The only code is:

0 -- Continue processing

Usage

Write code for a control's LoseFocus event if you want some processing to occur when the user changes focus to another control.

PowerBuilder programming note

Because the MessageBox function grabs focus, you should not use it when focus is changing, such as in a LoseFocus event. Instead, you might display a message in the window's title or a MultiLineEdit.

When to call AcceptText

You should not call AcceptText in the LoseFocus event or from a user event posted from LoseFocus, unless the DataWindow control no longer has focus. For information about the right way to call AcceptText when the DataWindow control loses focus, see the AcceptText method.

See also

GetFocus

AcceptText method