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)

Syntax

[BrowsableAttribute(true)]
public event KeyEventHandler KeyUp
public:
[BrowsableAttribute(true)]
event KeyEventHandler^ KeyUp {
    void add(KeyEventHandler^ value);
    void remove(KeyEventHandler^ value);
}
[<BrowsableAttribute(true)>]
member KeyUp : IEvent<KeyEventHandler,
    KeyEventArgs>
<BrowsableAttribute(True)>
Public Event KeyUp As KeyEventHandler

Remarks

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.

Examples

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));
    }
}
Private Sub OvalShape1_KeyUp(
    ByVal sender As Object, 
    ByVal e As System.Windows.Forms.KeyEventArgs
  ) Handles OvalShape1.KeyUp

    ' Determine whether the key entered is the F1 key. 
    ' Display Help if it is.
    If e.KeyCode = Keys.F1 Then
        ' Display a pop-up Help message to assist the user.
        Help.ShowPopup(OvalShape1.Parent, 
          "This represents a router.", New Point(500, 500))
    End If
End Sub

See Also

Shape Class
Microsoft.VisualBasic.PowerPacks Namespace
How to: Draw Lines with the LineShape Control (Visual Studio)
How to: Draw Shapes with the OvalShape and RectangleShape Controls (Visual Studio)
Introduction to the Line and Shape Controls (Visual Studio)

Return to top