Showing posts with label OLEObject. Show all posts
Showing posts with label OLEObject. Show all posts

OLEObject Events



OLEObject GotFocus Event

This event occurs when an ActiveX control gets input focus.


OLEObject LostFocus Event

This event occurs when an ActiveX control loses input focus.

OLEObject GotFocus Event



Syntax
Private Sub OLEObject_GotFocus()
Enter Code
End Sub

This event occurs when an ActiveX control gets input focus.

Example
Private Sub ListBox1_GotFocus()
 ' runs when list box gets the focus
End Sub

Result
This example runs when ListBox1 gets the focus.

OLEObject LostFocus Event



Syntax
Private Sub OLEObject_LostFocus()
Enter Code
End Sub

This event occurs when an ActiveX control loses input focus.

Example
Private Sub ListBox1_LostFocus()
 ' runs when list box loses the focus
End Sub

Result
This example runs when ListBox1 loses the focus.