Class ControlHelper
Encapsulates common mothods related with Control Tree.
Inheritance
Inherited Members
Namespace: Telerik.WinControls
Assembly: Telerik.WinControls.dll
Syntax
public static class ControlHelper
Methods
BeginUpdate(Control)
Sends a WM_SETREDRAW message to the control, preventing any paint operation afterwards.
Declaration
public static void BeginUpdate(Control control)
Parameters
System.Windows.Forms.Control
control
|
BringToFront(IntPtr, Boolean)
Brings the window on top of the z-order.
Declaration
public static void BringToFront(IntPtr handle, bool activate)
Parameters
System.IntPtr
handle
|
System.Boolean
activate
|
EndUpdate(Control, Boolean)
Resumes Control's painting, previously suspended by a BeginUpdate call.
Declaration
public static void EndUpdate(Control control, bool invalidate)
Parameters
System.Windows.Forms.Control
control
|
System.Boolean
invalidate
|
EnumChildControls(Control, Boolean)
Enumerates all child controls of the specified parent and optionally traverses the entire tree using Depth-first approach.
Declaration
public static IEnumerable<Control> EnumChildControls(Control parent, bool recursive)
Parameters
System.Windows.Forms.Control
parent
|
System.Boolean
recursive
|
Returns
System.Collections.Generic.IEnumerable<System.Windows.Forms.Control>
|
EnumChildControls(Control, Boolean, Predicate<Control>)
Enumerates all child controls of the specified parent and optionally traverses the entire tree using Depth-first approach.
Declaration
public static IEnumerable<Control> EnumChildControls(Control parent, bool recursive, Predicate<Control> parentFilter)
Parameters
System.Windows.Forms.Control
parent
|
System.Boolean
recursive
|
System.Predicate<System.Windows.Forms.Control>
parentFilter
|
Returns
System.Collections.Generic.IEnumerable<System.Windows.Forms.Control>
|
FilterChildControls(Control, Filter, Boolean)
Enumerates the Control tree, starting from the provided parent as a root, and collects all the child controls that match the specified filter.
Declaration
public static List<Control> FilterChildControls(Control parent, Filter filter, bool recursive)
Parameters
System.Windows.Forms.Control
parent
|
Filter
filter
|
System.Boolean
recursive
|
Returns
System.Collections.Generic.List<System.Windows.Forms.Control>
|
FindAncestor<T>(Control)
Searches up the parent chain of controls, looking for an ancestor of the specified type.
Declaration
public static T FindAncestor<T>(Control child)
where T : Control
Parameters
System.Windows.Forms.Control
child
|
Returns
T
|
Type Parameters
T
|
FindDescendant(Control, Type)
Declaration
public static Control FindDescendant(Control parent, Type descendantType)
Parameters
System.Windows.Forms.Control
parent
|
System.Type
descendantType
|
Returns
System.Windows.Forms.Control
|
FindDescendant<T>(Control)
Searches down the control tree, using breadth-first approach, for a descendant of the specified type.
Declaration
public static T FindDescendant<T>(Control parent)
where T : Control
Parameters
System.Windows.Forms.Control
parent
|
Returns
T
|
Type Parameters
T
|
GetAnyDisposingInHierarchy(Control)
Declaration
public static bool GetAnyDisposingInHierarchy(Control child)
Parameters
System.Windows.Forms.Control
child
|
Returns
System.Boolean
|
GetChildControls<T>(Control)
Declaration
public static List<T> GetChildControls<T>(Control parent)
where T : Control
Parameters
System.Windows.Forms.Control
parent
|
Returns
System.Collections.Generic.List<T>
|
Type Parameters
T
|
GetChildControls<T>(Control, Boolean)
Collects all child controls of given type.
Declaration
public static List<T> GetChildControls<T>(Control parent, bool recursive)
where T : Control
Parameters
System.Windows.Forms.Control
parent
|
System.Boolean
recursive
|
Returns
System.Collections.Generic.List<T>
|
Type Parameters
T
|
GetControlStyle(Control, ControlStyles)
Determines whether the specified ControlStyle is applied to the provided control.
Declaration
public static bool GetControlStyle(Control instance, ControlStyles style)
Parameters
System.Windows.Forms.Control
instance
|
System.Windows.Forms.ControlStyles
style
|
Returns
System.Boolean
|
GetControlUnderMouse()
Declaration
public static Control GetControlUnderMouse()
Returns
System.Windows.Forms.Control
|
GetFirstControl<T>(Control, Boolean)
Gets the first Control of Type T, which is descendant of the specified Parent.
Declaration
public static T GetFirstControl<T>(Control parent, bool recursive)
where T : Control
Parameters
System.Windows.Forms.Control
parent
|
System.Boolean
recursive
|
Returns
T
|
Type Parameters
T
|
GetFocusedControl()
Gets the Control instance that currently contains the Keyboard focus.
Declaration
public static Control GetFocusedControl()
Returns
System.Windows.Forms.Control
|
GetLastControl<T>(Control, Boolean)
Gets the last Control of Type T, which is descendant of the specified Parent.
Declaration
public static T GetLastControl<T>(Control parent, bool recursive)
where T : Control
Parameters
System.Windows.Forms.Control
parent
|
System.Boolean
recursive
|
Returns
T
|
Type Parameters
T
|
GetNextControl<T>(Control, T, Boolean, Boolean, Boolean)
Gets the Control of type T that is descendant of the specified parent and is anchored to the specified current T instance.
Declaration
public static T GetNextControl<T>(Control parent, T curr, bool recursive, bool forward, bool wrap)
where T : Control
Parameters
System.Windows.Forms.Control
parent
The parent control, which descendants are to be examined. |
T
curr
The current T instance to start the search from. |
System.Boolean
recursive
True to perform depth-first traversal of the Control Tree, false to look-up direct children only. |
System.Boolean
forward
True to search for a T instance that is next to the current specified one, false to search for a T instance that is previous to the current specified one. |
System.Boolean
wrap
True to start the search from the beginning when end of the search is reached. |
Returns
T
|
Type Parameters
T
A Control of Type T. |
InvalidateNonClient(Control, Boolean)
Forces the non-client area of the specified Control instance to be re-evaluated.
Declaration
public static void InvalidateNonClient(Control frame, bool activate)
Parameters
System.Windows.Forms.Control
frame
|
System.Boolean
activate
|
IsDescendant(Control, Control)
Determines whether the specified Child is contained within the specified Parent's Control Tree.
Declaration
public static bool IsDescendant(Control parent, Control child)
Parameters
System.Windows.Forms.Control
parent
|
System.Windows.Forms.Control
child
|
Returns
System.Boolean
|
SendToBack(IntPtr, Boolean)
Sends the
Declaration
public static void SendToBack(IntPtr handle, bool activate)
Parameters
System.IntPtr
handle
|
System.Boolean
activate
|