Shape.KeyUp Event

 

Occurs when a key is released and the shape has focus.

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

[BrowsableAttribute(true)]
public event KeyEventHandler KeyUp

Key events occur in the following order:

KeyDown 

KeyPress 

KeyUp

To handle keyboard events only at the form level and not enable shapes to receive keyboard events, set the Handled property in the form's KeyPress event-handling method to true.

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

The following example uses the KeyUp event together with the Help class to display pop-up style Help to the user.

This example requires that you have a OvalShape control named OvalShape1 on a form.

private void ovalShape1_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
    // Determine whether the key entered is the F1 key. 
    // Display Help if it is.
    if (e.KeyCode == Keys.F1)
    // Display a pop-up Help message to assist the user.
    {
        Help.ShowPopup(ovalShape1.Parent, "This represents a router.", 
            new Point(500, 500));
    }
}
Return to top
Show: