更新:2007 年 11 月
当进入形状时发生。
命名空间: Microsoft.VisualBasic.PowerPacks
程序集: Microsoft.VisualBasic.PowerPacks.Vs(在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)
语法
声明
<BrowsableAttribute(True)> _
Public Event Enter As EventHandler
用法
Dim instance As Shape
Dim handler As EventHandler
AddHandler instance.Enter, handler
[BrowsableAttribute(true)]
public event EventHandler Enter
[BrowsableAttribute(true)]
public:
event EventHandler^ Enter {
void add (EventHandler^ value);
void remove (EventHandler^ value);
}
JScript 不支持事件。
备注
当使用键盘(Tab、Shift+Tab 等)或者通过调用 Select 或 SelectNextControl(Shape, Boolean, Boolean, Boolean, Boolean) 方法更改焦点时,焦点事件将按以下顺序发生:
Enter
当使用鼠标或通过调用 Focus 方法更改焦点时,焦点事件将按以下顺序发生:
Enter
有关如何处理事件的更多信息,请参见使用事件。
示例
下面的示例演示如何在事件处理程序中响应 Enter 事件。 此示例要求窗体上有一个名为 RectangleShape1 的 RectangleShape 控件。
Private Sub RectangleShape1_Enter(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles RectangleShape1.Enter
MsgBox("The rectangle has been selected.")
End Sub
private void rectangleShape1_Enter(object sender, System.EventArgs e)
{
MessageBox.Show("The rectangle has been selected.");
}
权限
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。
另请参见
参考
Microsoft.VisualBasic.PowerPacks 命名空间
其他资源
如何:使用 LineShape 控件绘制直线 (Visual Studio)