Evento Shape.MouseHover

Ocorre quando o ponteiro do mouse é posicionado sobre a forma.

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

Sintaxe

'Declaração
<BrowsableAttribute(True)> _
Public Event MouseHover As EventHandler
[BrowsableAttribute(true)]
public event EventHandler MouseHover
[BrowsableAttribute(true)]
public:
 event EventHandler^ MouseHover {
    void add (EventHandler^ value);
    void remove (EventHandler^ value);
}
[<BrowsableAttribute(true)>]
member MouseHover : IEvent<EventHandler,
    EventArgs>
JScript não oferece suporte a eventos.

Comentários

Um uso típico de MouseHover é exibir uma dica de ferramenta quando o mouse pausa em uma área especificada ao redor da forma (o o retângulo de foco).A pausa necessária para este evento a ser gerado é especificada em milissegundos, o MouseHoverTime propriedade.

O MouseHover evento está definido e é detectado em conexão com o MouseHoverSize e MouseHoverTime propriedades.

Eventos de mouse ocorrem na seguinte ordem:

MouseEnter

MouseMove

MouseHover / MouseDown / MouseWheel

MouseUp

MouseLeave

Para obter mais informações sobre como manipular eventos, consulte Consumindo eventos.

Exemplos

O exemplo a seguir exibe uma mensagem na barra de status quando o mouse é movimentado sobre uma forma.Este exemplo requer que você tenha um RectangleShape controle chamado RectangleShape1 e um StatusStrip controle denominado StatusStrip1 em um formulário.O StatusStrip deve ter um ToolStripStatusLabel chamado ToolStripStatusLabel1.

Private Sub RectangleShape1_MouseEnter(
  ) Handles RectangleShape1.MouseEnter

    ToolStripStatusLabel1.Text = "The mouse has entered the shape."
End Sub

Private Sub RectangleShape1_MouseHover(
  ) Handles RectangleShape1.MouseHover

    ToolStripStatusLabel1.Text = "The mouse is paused over the shape."
End Sub

Private Sub RectangleShape1_MouseLeave(
  ) Handles RectangleShape1.MouseLeave

    ToolStripStatusLabel1.Text = "The mouse has left the shape."
End Sub

Private Sub RectangleShape1_MouseMove(
  ) Handles RectangleShape1.MouseMove

    ToolStripStatusLabel1.Text = "The mouse is over the shape."
End Sub
private void rectangleShape1_MouseEnter(object sender, System.EventArgs e)
{
    toolStripStatusLabel1.Text = "The mouse has entered the shape.";
}

private void rectangleShape1_MouseHover(object sender, System.EventArgs e)
{
    toolStripStatusLabel1.Text = "The mouse is paused over the shape.";
}

private void rectangleShape1_MouseLeave(object sender, System.EventArgs e)
{
    toolStripStatusLabel1.Text = "The mouse has left the shape.";
}

private void rectangleShape1_MouseMove(object sender, 
    System.Windows.Forms.MouseEventArgs e)
{
    toolStripStatusLabel1.Text = "The mouse is over the shape.";
}

Segurança do .NET Framework

Consulte também

Referência

Shape Classe

Namespace Microsoft.VisualBasic.PowerPacks

Outros recursos

Como: desenhar linhas com o controle de LineShape (Visual Studio)

Como: desenhar formas com os controles de RectangleShape (Visual Studio) e o OvalShape

Introdução à linha e controles Shape (Visual Studio)