共用方式為


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 安全性

請參閱

參考

WindowEventsClass 類別

EnvDTE 命名空間