Shape.Leave Event

 

Occurs when the input focus leaves the shape.

Namespace:   Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

[BrowsableAttribute(true)]
public event EventHandler Leave

When you change the focus by using the keyboard (TAB, SHIFT+TAB, and so on), or by calling the Select or M:Microsoft.VisualBasic.PowerPacks.Shape.SelectNextControl(Microsoft.VisualBasic.PowerPacks.Shape,System.Boolean,System.Boolean,System.Boolean,System.Boolean) method, focus events occur in the following order:

Enter 

GotFocus 

Leave

LostFocus 

When you change the focus by using the mouse or by calling the Focus method, focus events occur in the following order:

Enter 

GotFocus 

LostFocus 

Leave

For more information about how to handle events, see Handling and Raising Events.

The following example shows how to respond to the Leave event in an event handler. This example requires that you have a RectangleShape control named RectangleShape1 on a form.

private void rectangleShape1_Leave(object sender, System.EventArgs e)
{
    // Restore the default BackColor.
    rectangleShape1.BackColor = SimpleShape.DefaultBackColor;
}
Return to top
Show: