Evento Shape.KeyUp
Ocorre quando uma tecla é liberada e a forma tem o foco.
Namespace: Microsoft.VisualBasic.PowerPacks
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (em Microsoft.VisualBasic.PowerPacks.Vs.dll)
Sintaxe
'Declaração
<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 não oferece suporte a eventos.
Comentários
Os principais eventos ocorrem na seguinte ordem:
KeyUp
Para manipular eventos de teclado somente no nível do formulário e permitir que as formas receber eventos de teclado, defina o Handled propriedades do formulário KeyPress método do manipulador de eventos para true.
Para obter mais informações sobre como identificar eventos, consulte Manipulando e acionando eventos.
Exemplos
O exemplo a seguir usa o KeyUp eventos junto com o Help classe para exibir a Ajuda ao usuário do tipo pop-up.
Este exemplo requer que você tenha um OvalShape controle denominado OvalShape1 em um formulário.
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));
}
}
Segurança do .NET Framework
- Confiança total para o chamador imediato. O membro não pode ser usado por código parcialmente confiável. Para obter mais informações, consulte Usando bibliotecas de código parcialmente confiável.
Consulte também
Referência
Namespace Microsoft.VisualBasic.PowerPacks
Outros recursos
Como desenhar linhas com o controle LineShape (Visual Studio)
Como desenhar formas com os controles OvalShape e RectangleShape (Visual Studio)