Condividi tramite


Evento Shape.KeyUp

Si verifica quando una chiave viene rilasciata e la forma ha lo stato attivo.

Spazio dei nomi:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Sintassi

'Dichiarazione
<BrowsableAttribute(True)> _
Public Event KeyUp As KeyEventHandler
[BrowsableAttribute(true)]
public event KeyEventHandler KeyUp
[BrowsableAttribute(true)]
public:
 event KeyEventHandler^ KeyUp {
    void add (KeyEventHandler^ value);
    void remove (KeyEventHandler^ value);
}
[<BrowsableAttribute(true)>]
member KeyUp : IEvent<KeyEventHandler,
    KeyEventArgs>
JScript non supporta gli eventi.

Note

Gli eventi principali si verificano nel seguente ordine:

KeyDown

KeyPress

KeyUp

Per gestire gli eventi di tastiera solo a livello di form e per non consentire le forme per ricevere gli eventi della tastiera, impostare Handled proprietà del form KeyPress metodo per la gestione eventi a true.

per ulteriori informazioni su come gestire gli eventi, vedere Utilizzo degli eventi.

Esempi

Nell'esempio seguente viene utilizzato KeyUp evento insieme a Help classe per visualizzare la guida rapida di stile all'utente.

Questo esempio presuppone che l'utente abbia a OvalShape controllare OvalShape1 denominato in un form.

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
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));
    }
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Shape Classe

Spazio dei nomi Microsoft.VisualBasic.PowerPacks

Altre risorse

Procedura: disegnare linee con il controllo LineShape (Visual Studio)

Procedura: disegnare forme con i controlli OvalShape e RectangleShape (Visual Studio)

Introduzione ai controlli Line e Shape (Visual Studio)