WindowEventsClass.WindowActivated 事件
此 API 支持 .NET Framework 基础结构,不适合在代码中直接使用。
当窗口收到焦点时发生。
命名空间: EnvDTE
程序集: EnvDTE(在 EnvDTE.dll 中)
语法
声明
Public Overridable Event WindowActivated As _dispWindowEvents_WindowActivatedEventHandler
public virtual event _dispWindowEvents_WindowActivatedEventHandler WindowActivated
public:
virtual event _dispWindowEvents_WindowActivatedEventHandler^ WindowActivated {
void add (_dispWindowEvents_WindowActivatedEventHandler^ value);
void remove (_dispWindowEvents_WindowActivatedEventHandler^ value);
}
abstract WindowActivated : IEvent<_dispWindowEvents_WindowActivatedEventHandler,
EventArgs>
override WindowActivated : IEvent<_dispWindowEvents_WindowActivatedEventHandler,
EventArgs>
JScript 不支持事件。
实现
_dispWindowEvents_Event.WindowActivated
备注
直到环境完全初始化后才发生 WindowActivated,并且在环境启动期间第一个收到焦点的窗口也不发生该事件。
示例
Public Sub WindowEvents_WindowActivated(ByVal GotFocus As EnvDTE.Window, ByVal LostFocus As EnvDTE.Window) Handles WindowEvents.WindowActivated
MsgBox("test")
End Sub
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。