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.

C#
protected virtual void OnStartupNextInstance(Microsoft.VisualBasic.ApplicationServices.StartupNextInstanceEventArgs eventArgs);

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

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 5, 6, 7, 8, 9, 10

See also