ControlExtensions Class

Contains custom extension methods to use with Control.

Definition

Namespace: DevCase.Extensions.ControlExtensions
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[HideModuleNameAttribute]
public sealed class ControlExtensions
Inheritance
Object    ControlExtensions

Methods

Equals Determines whether the specified object is equal to the current object.
(Inherited from Object)
ForEachControl(Control, Boolean, ActionControl) Iterate through all the controls in the source Control and performs the specified action on each one.
ForEachControlT(Control, Boolean, ActionControl) Iterate through all the controls of the specified type in the source Control and performs the specified action on each one.
GetBoundsRelativeToForm Gets the bounds of the source Control relatively to its parent Form.
GetControlStyle Gets the value of the specified ControlStyles bit for the source control.
GetEventHandlers Gets all the delegates associated to the specified event raised by the source Control.
GetHashCode Serves as the default hash function.
(Inherited from Object)
GetNextControlT(Control, Boolean, Boolean, Boolean) Retrieves the next control of the specified type forward or back in the tab order of child controls.
GetNextControlT(Control, Boolean, Boolean, Boolean, ControlControlCollection) Retrieves the next control of the specified type forward or back in the tab order of child controls.
GetType Gets the Type of the current instance.
(Inherited from Object)
InvokeUITypeEditorT(Control, PropertyDescriptor) Invokes the default UITypeEditor to edit the specified property.
InvokeUITypeEditorT(Control, String) Invokes the default UITypeEditor to edit the specified property.
InvokeWhenHandleValid Performs an action on the specified Control after its handle has been created (that is, when HandleCreated event is fired).

If the handle has already been created, the action is executed immediately.

IsInDesignMode Determines whether the source Control is in design mode.
IsInRuntimeMode Determines whether the source Control is in runtime mode.
ResumeDrawing(Control) Allow the source Control to be redrawn.

By calling this method, it will allow painting events to be fired on the source Control.

ResumeDrawing(Control, Boolean) Allow the source Control to be redrawn.

By calling this method, it will allow painting events to be fired on the source Control.

SafeBeginInvoke(Control, Action) Safely executes the specified Action delegate asynchronously on the thread that owns the source control's underlying window handle.

This method automatically determines if the caller must call BeginInvoke(Delegate) method when making method calls to the source control on a different thread than the one the control was created on.

SafeBeginInvoke(Control, Delegate) Safely executes the specified Delegate delegate asynchronously on the thread that owns the source control's underlying window handle.

This method automatically determines if the caller must call BeginInvoke(Delegate) method when making method calls to the source control on a different thread than the one the control was created on.

SafeBeginInvoke(Control, Delegate, Object) Safely executes the specified Delegate delegate asynchronously on the thread that owns the source control's underlying window handle.

This method automatically determines if the caller must call BeginInvoke(Delegate, Object) method when making method calls to the source control on a different thread than the one the control was created on.

SafeInvoke(Control, Action) Safely executes the specified Action delegate on the thread that owns the source control's underlying window handle.

This method automatically determines if the caller must call Invoke(Delegate) method when making method calls to the source control on a different thread than the one the control was created on.

SafeInvoke(Control, Delegate) Safely executes the specified Delegate on the thread that owns the source control's underlying window handle.

This method automatically determines if the caller must call Invoke(Delegate) method when making method calls to the source control on a different thread than the one the control was created on.

SafeInvoke(Control, Delegate, Object) Safely executes the specified Delegate delegate on the thread that owns the source control's underlying window handle.

This method automatically determines if the caller must call Invoke(Delegate, Object) method when making method calls to the source control on a different thread than the one the control was created on.

SendKey(Control, VirtualKeys, KeyBehavior) Sends a keystroke to the specified control.
SendKey(Control, Keys, KeyBehavior) Sends a keystroke to the specified control.
SendMouseButton(Control, MouseButton) Sends a mouse button click to the specified control.
SendMouseButton(Control, MouseButton, Point) Sends a mouse button click to the specified coordinates on the specified control.
SetControlStyle Sets a specified ControlStyles flag to either or for the source control.
SetDoubleBuffer Sets the value of DoubleBuffered property for the source Control.

You should call this method to set double buffer for a control, instead of calling SetControlStyle(Control, ControlStyles, Boolean) method with OptimizedDoubleBuffer flag.

SetVisualTheme Changes the color appearance of the source Control using the specified theme.
SuspendDrawing Prevents the source Control from being redrawn.

By calling this method, it will disallow painting events from firing on the source Control.

ToString Returns a string that represents the current object.
(Inherited from Object)

Extension Methods

CanConvertTo Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions)
CanConvertToT Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions)
ConvertToT Converts an object to the specified target type.

If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions)

ConvertToT Converts an object to the specified target type.

If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions)

IsDisposable Determines whether the specified object is a disposable type (i.e., it implements IDisposable interface).
(Defined by ObjectExtensions)
Speak Speaks the string representation of the source object by using the operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions)
Speak Speaks the string representation of the source object by using the operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions)
ThrowIfNullTException Throws the specified exception if the source object is null.
(Defined by ObjectExtensions)

See Also