Condividi tramite


Evento Shape.KeyUp

Si verifica quando si rilascia un tasto 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

Chiavi eventi si verificano nell'ordine seguente:

KeyDown

KeyPress

KeyUp

Per gestire eventi di tastiera solo a livello di modulo e non abilitare forme di ricevere gli eventi di tastiera, impostare il Handled proprietà del modulo KeyPress metodo di gestione degli eventi per true.

Per ulteriori informazioni su come gestire gli eventi, vedere Gestione e generazione di eventi.

Esempi

Nell'esempio seguente viene utilizzata la KeyUp evento con il Help classe per visualizzare la finestra popup della Guida per l'utente.

Si suppone di disporre di un OvalShape controllo denominato OvalShape1 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)