DialogPage.OnActivate Method
Handles Windows Activate messages from the Visual Studio environment.
Namespace: Microsoft.VisualStudio.Shell
Assemblies: Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)
Microsoft.VisualStudio.Shell.9.0 (in Microsoft.VisualStudio.Shell.9.0.dll)
Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)
Syntax
'Declaración
Protected Overridable Sub OnActivate ( _
e As CancelEventArgs _
)
'Uso
Dim e As CancelEventArgs
Me.OnActivate(e)
protected virtual void OnActivate(
CancelEventArgs e
)
protected:
virtual void OnActivate(
CancelEventArgs^ e
)
abstract OnActivate :
e:CancelEventArgs -> unit
override OnActivate :
e:CancelEventArgs -> unit
protected function OnActivate(
e : CancelEventArgs
)
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