HTMLWindowEvents4::onfocusout Event
.png)
[This documentation is preliminary and is subject to change.]
Fires for the current element with focus immediately after moving focus to another element.
Syntax
void onfocusout( IHTMLEventObj *pEvtObj );
Parameters
- pEvtObj
[in] Pointer to an IHTMLEventObj interface for the current event. This is the same interface returned from IHTMLWindow2::event.
Return Value
No return value.
Event DISPID
DISPID_HTMLWINDOWEVENTS4_ONFOCUSOUTThe DISPID for this event is defined in mshtmdid.h. Use this value to identify the event handler when implementing IDispatch::Invoke.
Event Information
Bubbles Yes Cancels No To invoke Default action N/A
Event Object Properties
The IHTMLEventObj interface contains additional information about the current event. When the onfocusout event is fired, you can use the IHTMLWindow2::event property to retrieve an IHTMLEventObj interface. To obtain an alternate interface pointer such as IHTMLEventObj2 or IHTMLEventObj3, call QueryInterface on the object.
Refer to the specific event object for additional event properties.
Remarks
With Microsoft Internet Explorer 5.5 and later, focus on a document and the active element of a document can be managed separately. Use the HTMLWindowEvents4::onfocusout event to manage formatting changes when an element loses focus.
Each document may have up to one active element. Set the active element with the IHTMLElement3::setActive or IHTMLControlElement::focus methods. Using the IHTMLElement3::setActive method has no effect on document focus. Using the IHTMLControlElement::focus method on an individual element causes the element to gain focus and become the active element, and this causes HTMLWindowEvents4::onfocusout to fire for this active element.
Using the IHTMLControlElement::focus method on a document that does not have the focus moves the document to the front of the display. Additionally, the document's active element gains focus, and this causes HTMLWindowEvents4::onfocusout to fire for this active element.
For a given display, only one element has focus at any given time. Striking a key directly affects only the element with focus. Events fired by that keystroke may be scripted to affect other documents and child elements.
See Also
HTMLElementEvents::onfocusin, HTMLElementEvents::onbeforedeactivate, HTMLElementEvents::ondeactivate, HTMLElementEvents::onbeforeactivate, HTMLElementEvents::onactivate