Class GorgonControlExtensions
Extension methods for the Control base class.
Inherited Members
Namespace: System.Windows.Forms
Assembly: Gorgon.Windows.dll
Syntax
public static class GorgonControlExtensions
Methods
| Edit this page View SourceGetAncestor<T>(Control)
Function to retrieve the ancestor for this control that matches the type specifier.
Declaration
public static T GetAncestor<T>(this Control control) where T : Control
Parameters
Type | Name | Description |
---|---|---|
Control | control | The control to start the search from. |
Returns
Type | Description |
---|---|
T | The very first ancestor of this control matching |
Type Parameters
Name | Description |
---|---|
T | The type of control to find. Must inherit from Control. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
GetFirstAncestor<T>(Control)
Function to retrieve the first ancestor of this control that matches the type specifier.
Declaration
public static T GetFirstAncestor<T>(this Control control) where T : Control
Parameters
Type | Name | Description |
---|---|---|
Control | control | The control to start the search from. |
Returns
Type | Description |
---|---|
T | The very first ancestor of this control matching |
Type Parameters
Name | Description |
---|---|
T | The type of control to find. Must inherit from Control. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
GetForm<T>(Control)
Function to retrieve the form in which this control is contained.
Declaration
public static T GetForm<T>(this Control control) where T : Form
Parameters
Type | Name | Description |
---|---|---|
Control | control | The control to start searching from. |
Returns
Type | Description |
---|---|
T | The Form of type |
Type Parameters
Name | Description |
---|---|
T | Type of form. Must inherit from Form. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |