Compartir a través de


Shape.MouseHover (Evento)

Se produce cuando el puntero del mouse permanece en la forma.

Espacio de nombres:  Microsoft.VisualBasic.PowerPacks
Ensamblado:  Microsoft.VisualBasic.PowerPacks.Vs (en Microsoft.VisualBasic.PowerPacks.Vs.dll)

Sintaxis

'Declaración
<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 no admite eventos.

Comentarios

Un uso típico de MouseHover es mostrar una información sobre herramientas cuando el mouse se detiene en un área especificada alrededor de la forma (la rectángulo). La pausa necesaria para que se produzca este evento se especifica en milisegundos por la MouseHoverTime propiedad.

El MouseHover evento se define y se detecta en relación con el MouseHoverSize y MouseHoverTime propiedades.

Los eventos del mouse se producen en el siguiente orden:

MouseEnter

MouseMove

MouseHover / MouseDown / MouseWheel

MouseUp

MouseLeave

Para obtener más información acerca de cómo controlar eventos, vea Controlar y provocar eventos.

Ejemplos

En el ejemplo siguiente se muestra un mensaje en la barra de estado cuando se mueve el mouse sobre una forma. Este ejemplo requiere que haya un RectangleShape control denominado RectangleShape1 y un StatusStrip control denominado StatusStrip1 en un formulario. El StatusStrip debe tener un ToolStripStatusLabel denominado 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.";
}

Seguridad de .NET Framework

Vea también

Referencia

Shape Clase

Microsoft.VisualBasic.PowerPacks (Espacio de nombres)

Otros recursos

Cómo: Dibujar líneas con el control LineShape (Visual Studio)

Cómo: Dibujar formas con los controles OvalShape y RectangleShape (Visual Studio)

Introducción a los controles de líneas y formas (Visual Studio)