Zdarzenie Shape.MouseLeave
Występuje, gdy wskaźnik myszy opuści kształtu.
Przestrzeń nazw: Microsoft.VisualBasic.PowerPacks
Zestaw: Microsoft.VisualBasic.PowerPacks.Vs (w Microsoft.VisualBasic.PowerPacks.Vs.dll)
Składnia
'Deklaracja
<BrowsableAttribute(True)> _
Public Event MouseLeave As EventHandler
[BrowsableAttribute(true)]
public event EventHandler MouseLeave
[BrowsableAttribute(true)]
public:
event EventHandler^ MouseLeave {
void add (EventHandler^ value);
void remove (EventHandler^ value);
}
[<BrowsableAttribute(true)>]
member MouseLeave : IEvent<EventHandler,
EventArgs>
Język JScript nie obsługuje zdarzeń.
Uwagi
Zdarzenia myszy zachodzą w następującej kolejności:
MouseHover / MouseDown / MouseWheel
MouseLeave
Aby uzyskać więcej informacji na temat obsługi zdarzeń, zobacz Obsługa i wywoływanie zdarzeń.
Przykłady
Poniższy przykład wyświetla komunikat na pasku stanu, kiedy wskaźnik myszy zostanie przesunięty na kształcie.W tym przykładzie wymaga RectangleShape formantu o nazwie RectangleShape1 i StatusStrip formantu o nazwie StatusStrip1 na formularzu.StatusStrip Musi mieć ToolStripStatusLabel o nazwie 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.";
}
Zabezpieczenia programu .NET Framework
- Pełne zaufanie do bezpośredniego wywołującego. Tego elementu członkowskiego nie można używać w kodzie częściowo zaufanym. Aby uzyskać więcej informacji, zobacz Używanie bibliotek pochodzących z częściowo zaufanego kodu.
Zobacz też
Informacje
Przestrzeń nazw Microsoft.VisualBasic.PowerPacks
Inne zasoby
Porady: rysowanie linii za pomocą formantów LineShape (Visual Studio)
Porady: rysowanie kształtów za pomocą formantów OvalShape i RectangleShape (Visual Studio)
Linie i kształty — Wprowadzenie do formantów (Visual Studio)