WindowsFormsApplicationBase.OnStartupNextInstance Method

Definition

When overridden in a derived class, allows for code to run when a subsequent instance of a single-instance application starts.

protected:
 virtual void OnStartupNextInstance(Microsoft::VisualBasic::ApplicationServices::StartupNextInstanceEventArgs ^ eventArgs);
protected virtual void OnStartupNextInstance (Microsoft.VisualBasic.ApplicationServices.StartupNextInstanceEventArgs eventArgs);
abstract member OnStartupNextInstance : Microsoft.VisualBasic.ApplicationServices.StartupNextInstanceEventArgs -> unit
override this.OnStartupNextInstance : Microsoft.VisualBasic.ApplicationServices.StartupNextInstanceEventArgs -> unit
Protected Overridable Sub OnStartupNextInstance (eventArgs As StartupNextInstanceEventArgs)

Parameters

eventArgs
StartupNextInstanceEventArgs

The command-line arguments of the subsequent application instance and indicates whether the first application instance should be brought to the foreground upon exiting the exception handler.

Remarks

By default, this method raises the StartupNextInstance event. The event handler can set the BringToForeground property of the event argument. If BringToForeground is True, the method activates the main form. Otherwise, the main form is left in its current state.

Applies to

See also