System.Windows.Forms.MainMenu.GetForm Method

Gets the System.Windows.Forms.Form that contains this control.

Syntax

public Form GetForm ()

Returns

A System.Windows.Forms.Form that is the container for this control. Returns null if the System.Windows.Forms.MainMenu is not currently hosted on a form.

Remarks

This property enables you to determine if a specific System.Windows.Forms.MainMenu is parented to a form. The property is typically used when multiple System.Windows.Forms.MainMenu objects are being used on a form and you need to determine which one is currently being used by a form.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0