Shape.MouseLeave 事件
,当鼠标指针离开形状,发生。
命名空间: Microsoft.VisualBasic.PowerPacks
程序集: Microsoft.VisualBasic.PowerPacks.Vs(在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)
语法
声明
<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 不支持事件。
备注
鼠标事件按以下顺序发生:
MouseHover / MouseDown / MouseWheel
MouseLeave
有关如何处理事件的更多信息,请参见使用事件。
示例
,当鼠标移动在形状时,下面的示例演示在状态栏中显示一条消息。 此示例要求您具有一个 RectangleShape 控件 RectangleShape1 的、名为在窗体的 StatusStrip1 的一个 StatusStrip 控件。 StatusStrip 必须有名 ToolStripStatusLabel1 的 ToolStripStatusLabel 。
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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。
请参见
参考
Microsoft.VisualBasic.PowerPacks 命名空间
其他资源
如何:使用 LineShape 控件绘制直线 (Visual Studio)