ApplicationContext.MainForm Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the Form to use as context.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public Form MainForm { get; set; }

Property Value

Type: System.Windows.Forms.Form

The Form to use as context.

This property determines the main Form for this context. This property can change at any time. If OnMainFormClosed is not overridden, the message loop of the thread terminates when the mainForm parameter closes.

.NET Framework
Available since 1.1
Return to top