DialogPage.OnActivate Method
Handles Windows Activate messages from the Visual Studio environment.
Namespace: Microsoft.VisualStudio.Shell
Assembly: Microsoft.VisualStudio.Shell.11.0 (in Microsoft.VisualStudio.Shell.11.0.dll)
Syntax
'宣言
Protected Overridable Sub OnActivate ( _
e As CancelEventArgs _
)
protected virtual void OnActivate(
CancelEventArgs e
)
Parameters
- e
Type: System.ComponentModel.CancelEventArgs
[in] Arguments to event handler.
Remarks
This method is a handler for Windows events, and is not a managed delegate.
An Activate message is sent, and this method is called when the user interface of the dialog page is visible and receives focus.
The default implementation sets the dialog page's internal user interface state to active.
Because this state is used throughout the parent class, implementations should always call the base implementation of this method when overriding.
Examples
This example implementation of OnActivate first calls the base implementation of the method, and then refreshes user controls.
protected override void OnActivate(CancelEventArgs e) {
base.OnActivate(e);
Panel.OnActivate(); // we want to reload controls from toolbox...
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.VisualStudio.Shell Namespace