System.Windows.Forms.Control.FindForm Method

Retrieves the form that the control is on.

Syntax

public Form FindForm ()

Returns

The System.Windows.Forms.Form that the control is on.

Remarks

The control's Control.Parent property value might not be the same as the System.Windows.Forms.Form returned by Control.FindForm method. For example, if a System.Windows.Forms.RadioButton control is contained within a System.Windows.Forms.GroupBox control, and the System.Windows.Forms.GroupBox is on a System.Windows.Forms.Form, the System.Windows.Forms.RadioButton control's Control.Parent is the System.Windows.Forms.GroupBox and the System.Windows.Forms.GroupBox control's Control.Parent is the System.Windows.Forms.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