Evento Shape.MouseHover
Si verifica quando il puntatore del mouse è posizionato sulla forma.
Spazio dei nomi: Microsoft.VisualBasic.PowerPacks
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Sintassi
'Dichiarazione
<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 non supporta gli eventi.
Note
Un tipico utilizzo di MouseHover consiste nel visualizzare una descrizione comando quando si posiziona il mouse in un'area attorno alla forma specificata (il rettangolo hover). Sospendi necessari per la generazione dell'evento sono espresso in millisecondi per il MouseHoverTime proprietà.
Il MouseHover evento viene definito e rilevato insieme il MouseHoverSize e MouseHoverTime proprietà.
Gli eventi del mouse si verificano nell'ordine seguente:
MouseHover / MouseDown / MouseWheel
Per ulteriori informazioni su come gestire gli eventi, vedere Gestione e generazione di eventi.
Esempi
Nell'esempio seguente viene visualizzato un messaggio nella barra di stato quando il mouse viene spostato su una forma. Si suppone di disporre di un RectangleShape controllo denominato RectangleShape1 e un StatusStrip controllo denominato StatusStrip1 in un form. Il StatusStrip deve avere un ToolStripStatusLabel denominato 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.";
}
Sicurezza di .NET Framework
- Attendibilità totale per il chiamante immediato. Impossibile utilizzare questo membro in codice parzialmente attendibile. Per altre informazioni, vedere Utilizzo di librerie da codice parzialmente attendibile.
Vedere anche
Riferimenti
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)