GotFocus Event

Applies To

CheckBox control, ComboBox control, CommandButton control, Image control, Label control, ListBox control, OptionButton control, ScrollBar control, SpinButton control, TextBox control, ToggleButton control.

Description

Occurs when the focus is moved to an embedded ActiveX control.

Syntax

Private Sub object_GotFocus( )

object The name of an ActiveX control.

See Also

Close event, DocumentChange event, LostFocus event, New event, Open event, Quit event.

Example

This example displays a message when the focus moves to CheckBox1.

Private Sub CheckBox1_GotFocus()
    Msgbox "Check this box if you are a permanent employee."
End Sub