Freigeben über


Shape.MouseLeave-Ereignis

Tritt auf, wenn der Mauszeiger die Form verlässt.

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

Syntax

'Declaration
<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>
JScript unterstützt keine Ereignisse.

Hinweise

Mausereignisse treten in der folgenden Reihenfolge auf:

MouseEnter

MouseMove

MouseHover / MouseDown / MouseWheel

MouseUp

MouseLeave

Weitere Informationen zum Behandeln von Ereignissen finden Sie unter Behandeln und Auslösen von Ereignissen.

Beispiele

Im folgende Beispiel zeigt eine Meldung in der Statusleiste angezeigt, wenn die Maus, über eine Form bewegt wird. In diesem Beispiel benötigen Sie ein RectangleShape -Steuerelement namens RectangleShape1 und eine StatusStrip Steuerelement namens StatusStrip1 in einem Formular. Die StatusStrip muss ein ToolStripStatusLabel mit dem Namen 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.";
}

.NET Framework-Sicherheit

Siehe auch

Referenz

Shape Klasse

Microsoft.VisualBasic.PowerPacks-Namespace

Weitere Ressourcen

Gewusst wie: Zeichnen von Linien mit dem LineShape-Steuerelement (Visual Studio)

Gewusst wie: Zeichnen von Formen mit dem OvalShape-Steuerelement und dem RectangleShape-Steuerelement (Visual Studio)

Einführung in das Line-Steuerelement und das Shape-Steuerelement (Visual Studio)