Wisej.Web.Markup.ControlExtensions
Namespace: Wisej.Web.Markup
Assembly: Wisej.Framework (4.0.0.0)
Adds fluent markup extension methods to the Control class.
public class ControlExtensionsPublic Class ControlExtensionsSets the accessible description for the specified control.
Returns: . The control with the updated accessible description.
Sets the accessible name for the specified control.
Returns: . The control with the updated accessible name.
Sets the accessible role for the specified control.
Returns: . The control with the updated accessible role.
Sets the AllowDrop property for the specified control, enabling or disabling drag-and-drop operations.
Returns: . The control with the updated AllowDrop property.
Executes a specified action on the control and returns the control.
Returns: . The control after the action has been executed.
This method allows for chaining operations on a control by executing an action and returning the control itself.
Sets the anchor styles for the specified control.
Returns: . The control with the updated anchor styles.
Returns: .
Sets the auto-scroll offset for the specified control.
Returns: . The control with the updated auto-scroll offset.
Sets the AutoSize property for the specified control, enabling or disabling automatic resizing.
Returns: . The control with the updated AutoSize property.
Sets the background color for the specified control.
Returns: . The control with the updated background color.
Sets the background image for the specified control.
Returns: . The control with the updated background image.
Sets the layout of the background image for the specified control.
Returns: . The control with the updated background image layout.
Sets the bounds of the specified control using a .
Returns: . The control with the updated bounds.
Sets the top and left position of the specified control, maintaining its current width and height.
Returns: . The control with the updated top and left position.
Sets the bounds of the specified control using specified top, left, width, and height values.
Returns: . The control with the updated bounds.
Brings the control to the front of the z-order.
Returns: . The control instance after being brought to the front.
This method changes the z-order of the control so that it appears in front of all other controls.
Invokes a specified JavaScript function on the control with the provided arguments.
Returns: . The control instance after the function call.
This extension method allows you to call a function on a control dynamically by name, passing any required arguments.
Invokes a specified JavaScript function on the control with the provided arguments and a callback.
Returns: . The control instance after the function call.
This extension method allows you to call a function on a control dynamically by name, passing any required arguments and a callback to handle the result.
Sets the capture property for the specified control, determining whether the control has captured the mouse.
Returns: . The control with the updated capture property.
Sets the CausesValidation property for the specified control, determining whether the control causes validation to be performed on any controls that require validation.
Returns: . The control with the updated CausesValidation property.
Centers the control within its parent, optionally horizontally and/or vertically.
Returns: . The control instance after centering.
This method centers the control within its parent container based on the specified axes.
Sets the client size for the specified control.
Returns: . The control with the updated client size.
Sets the context menu for the specified control.
Returns: . The control with the updated context menu.
Adds an array of child controls to the specified control.
Returns: . The control with the added child controls.
This method suspends the layout of the control, adds the child controls, and then resumes the layout. Controls with are brought to the front.
Forces the creation of the control and its handle.
Returns: . The control instance after creation.
This method ensures that the control and its underlying handle are created.
Sets the cursor for the specified control.
Returns: . The control with the updated cursor.
Sets the dock style for the specified control.
Returns: . The control with the updated dock style.
Sets the enabled state for the specified control.
Returns: . The control with the updated enabled state.
Evaluates the specified JavaScript code in the context of the control, optionally with a callback.
Returns: . The control instance after the JavaScript evaluation.
This method executes JavaScript code in the context of the control. If a callback is provided, it will be invoked with the result of the evaluation.
Returns: .
Sets the font for the specified control.
Returns: . The control with the updated font.
Sets the font size for the specified control while maintaining the current font family.
Returns: . The control with the updated font size.
Sets the foreground color for the specified control.
Returns: . The control with the updated foreground color.
Sets the height for the specified control.
Returns: . The control with the updated height.
Hides the control.
Returns: . The control instance after being hidden.
This method makes the control invisible.
Attaches an action to be executed when the control loses focus.
Returns: . The control with the attached leave event action.
This method allows you to specify an action that will be executed when the control's Leave event is triggered.
Sets the left position for the specified control.
Returns: . The control with the updated left position.
Sets the location for the specified control.
Returns: . The control with the updated location.
Sets the location for the specified control using left and top coordinates.
Returns: . The control with the updated location.
Sets the margin for the specified control using a object.
Returns: . The control with the updated margin.
Sets the margin for the specified control using an array of integers.
Returns: . The control with the updated margin.
This method allows setting the margin using different configurations of padding values.
Throws:
Thrown when the padding array is null.
Thrown when the padding array length is not 1, 2, or 4.
Sets the maximum size for the specified control using a object.
Returns: . The control with the updated maximum size.
Sets the maximum size for the specified control using width and height values.
Returns: . The control with the updated maximum size.
Sets the minimum size for the specified control using a object.
Returns: . The control with the updated minimum size.
Sets the minimum size for the specified control using width and height values.
Returns: . The control with the updated minimum size.
Sets the name for the specified control.
Returns: . The control with the updated name.
Attaches an action to be executed when the AutoSize property of the control changes.
Returns: . The control with the attached AutoSizeChanged event action.
This method allows you to specify an action that will be executed when the control's AutoSizeChanged event is triggered.
Attaches an action to be executed when the BackColor property of the control changes.
Returns: . The control with the attached BackColorChanged event action.
This method allows you to specify an action that will be executed when the control's BackColorChanged event is triggered.
Attaches an action to be executed when the BackgroundImage property of the control changes.
Returns: . The control with the attached BackgroundImageChanged event action.
This method allows you to specify an action that will be executed when the control's BackgroundImageChanged event is triggered.
Attaches an action to be executed when the BackgroundImageLayout property of the control changes.
Returns: . The control with the attached BackgroundImageLayoutChanged event action.
This method allows you to specify an action that will be executed when the control's BackgroundImageLayoutChanged event is triggered.
Attaches an action to be executed when the BindingContext property of the control changes.
Returns: . The control with the attached BindingContextChanged event action.
This method allows you to specify an action that will be executed when the control's BindingContextChanged event is triggered.
Attaches an action to be executed when the CausesValidation property of the control changes.
Returns: . The control with the attached CausesValidationChanged event action.
This method allows you to specify an action that will be executed when the control's CausesValidationChanged event is triggered.
Attaches an action to be executed when the control is clicked.
Returns: . The control with the attached Click event action.
This method allows you to specify an action that will be executed when the control's Click event is triggered.
Attaches an action to be executed when the ClientSize property of the control changes.
Returns: . The control with the attached ClientSizeChanged event action.
This method allows you to specify an action that will be executed when the control's ClientSizeChanged event is triggered.
Attaches an action to be executed when the ContextMenu property of the control changes.
Returns: . The control with the attached ContextMenuChanged event action.
This method allows you to specify an action that will be executed when the control's ContextMenuChanged event is triggered.
Attaches an action to be executed when a control is added to the control's collection.
Returns: . The control with the attached ControlAdded event action.
This method allows you to specify an action that will be executed when the control's ControlAdded event is triggered.
Attaches an action to be executed when a control is removed from the control's collection.
Returns: . The control with the attached ControlRemoved event action.
This method allows you to specify an action that will be executed when the control's ControlRemoved event is triggered.
Attaches an action to be executed when the Cursor property of the control changes.
Returns: . The control with the attached CursorChanged event action.
This method allows you to specify an action that will be executed when the control's CursorChanged event is triggered.
Attaches an action to be executed when the Dock property of the control changes.
Returns: . The control with the attached DockChanged event action.
This method allows you to specify an action that will be executed when the control's DockChanged event is triggered.
Attaches an action to be executed when the control is double-clicked.
Returns: . The control with the attached DoubleClick event action.
This method allows you to specify an action that will be executed when the control's DoubleClick event is triggered.
Attaches an action to be executed when a drag-and-drop operation is completed on the control.
Returns: . The control with the attached DragDrop event action.
This method allows you to specify an action that will be executed when the control's DragDrop event is triggered.
Attaches an action to be executed when an object is dragged into the control's bounds.
Returns: . The control with the attached DragEnter event action.
This method allows you to specify an action that will be executed when the control's DragEnter event is triggered.
Attaches an action to be executed when an object is dragged out of the control's bounds.
Returns: . The control with the attached DragLeave event action.
This method allows you to specify an action that will be executed when the control's DragLeave event is triggered.
Attaches an action to be executed when an object is dragged over the control's bounds.
Returns: . The control with the attached DragOver event action.
This method allows you to specify an action that will be executed when the control's DragOver event is triggered.
Attaches an action to be executed when the Enabled property of the control changes.
Returns: . The control with the attached EnabledChanged event action.
This method allows you to specify an action that will be executed when the control's EnabledChanged event is triggered.
Attaches an action to be executed when the control receives focus.
Returns: . The control with the attached Enter event action.
This method allows you to specify an action that will be executed when the control's Enter event is triggered.
Attaches an action to be executed when the Font property of the control changes.
Returns: . The control with the attached FontChanged event action.
This method allows you to specify an action that will be executed when the control's FontChanged event is triggered.
Attaches an action to be executed when the ForeColor property of the control changes.
Returns: . The control with the attached ForeColorChanged event action.
This method allows you to specify an action that will be executed when the control's ForeColorChanged event is triggered.
Attaches an action to be executed when the control receives focus.
Returns: . The control with the attached GotFocus event action.
This method allows you to specify an action that will be executed when the control's GotFocus event is triggered.
Attaches an action to be executed when the control's handle is created.
Returns: . The control with the attached HandleCreated event action.
This method allows you to specify an action that will be executed when the control's HandleCreated event is triggered.
Attaches an action to be executed when the control's handle is destroyed.
Returns: . The control with the attached HandleDestroyed event action.
This method allows you to specify an action that will be executed when the control's HandleDestroyed event is triggered.
Attaches an action to be executed when a help request is made for the control.
Returns: . The control with the attached HelpRequested event action.
This method allows you to specify an action that will be executed when the control's HelpRequested event is triggered.
Attaches an action to be executed when a key is pressed while the control has focus.
Returns: . The control with the attached KeyDown event action.
This method allows you to specify an action that will be executed when the control's KeyDown event is triggered.
Attaches an action to be executed when a key is pressed and released while the control has focus.
Returns: . The control with the attached KeyPress event action.
This method allows you to specify an action that will be executed when the control's KeyPress event is triggered.
Attaches an action to be executed when a key is released while the control has focus.
Returns: . The control with the attached KeyUp event action.
This method allows you to specify an action that will be executed when the control's KeyUp event is triggered.
Attaches an action to be executed when the layout of the control is changed.
Returns: . The control with the attached Layout event action.
This method allows you to specify an action that will be executed when the control's Layout event is triggered.
Attaches an action to be executed when the Location property of the control changes.
Returns: . The control with the attached LocationChanged event action.
This method allows you to specify an action that will be executed when the control's LocationChanged event is triggered.
Attaches an action to be executed when the control loses focus.
Returns: . The control with the attached LostFocus event action.
This method allows you to specify an action that will be executed when the control's LostFocus event is triggered.
Attaches an action to be executed when the Margin property of the control changes.
Returns: . The control with the attached MarginChanged event action.
This method allows you to specify an action that will be executed when the control's MarginChanged event is triggered.
Attaches an action to be executed when the mouse capture changes for the control.
Returns: . The control with the attached MouseCaptureChanged event action.
This method allows you to specify an action that will be executed when the control's MouseCaptureChanged event is triggered.
Attaches an action to be executed when the control is clicked with the mouse.
Returns: . The control with the attached MouseClick event action.
This method allows you to specify an action that will be executed when the control's MouseClick event is triggered.
Attaches an action to be executed when the control is double-clicked with the mouse.
Returns: . The control with the attached MouseDoubleClick event action.
This method allows you to specify an action that will be executed when the control's MouseDoubleClick event is triggered.
Attaches an action to be executed when a mouse button is pressed while the pointer is over the control.
Returns: . The control with the attached MouseDown event action.
This method allows you to specify an action that will be executed when the control's MouseDown event is triggered.
Attaches an action to be executed when the mouse pointer enters the control's bounds.
Returns: . The control with the attached MouseEnter event action.
This method allows you to specify an action that will be executed when the control's MouseEnter event is triggered.
Attaches an action to be executed when the mouse pointer hovers over the control.
Returns: . The control with the attached MouseHover event action.
This method allows you to specify an action that will be executed when the control's MouseHover event is triggered.
Attaches an action to be executed when the mouse pointer leaves the control's bounds.
Returns: . The control with the attached MouseLeave event action.
This method allows you to specify an action that will be executed when the control's MouseLeave event is triggered.
Attaches an action to be executed when the mouse pointer moves over the control.
Returns: . The control with the attached MouseMove event action.
This method allows you to specify an action that will be executed when the control's MouseMove event is triggered.
Attaches an action to be executed when a mouse button is released while the pointer is over the control.
Returns: . The control with the attached MouseUp event action.
This method allows you to specify an action that will be executed when the control's MouseUp event is triggered.
Attaches an action to be executed when the mouse wheel is rotated while the pointer is over the control.
Returns: . The control with the attached MouseWheel event action.
This method allows you to specify an action that will be executed when the control's MouseWheel event is triggered.
Attaches an action to be executed when the control is moved.
Returns: . The control with the attached Move event action.
This method allows you to specify an action that will be executed when the control's Move event is triggered.
Attaches an action to be executed when the Padding property of the control changes.
Returns: . The control with the attached PaddingChanged event action.
This method allows you to specify an action that will be executed when the control's PaddingChanged event is triggered.
Attaches an action to be executed when the control is repainted.
Returns: . The control with the attached Paint event action.
This method allows you to specify an action that will be executed when the control's Paint event is triggered.
Attaches an action to be executed when the Parent property of the control changes.
Returns: . The control with the attached ParentChanged event action.
This method allows you to specify an action that will be executed when the control's ParentChanged event is triggered.
Attaches an action to be executed when a key is pressed while the control has focus, before the key event is processed.
Returns: . The control with the attached PreviewKeyDown event action.
This method allows you to specify an action that will be executed when the control's PreviewKeyDown event is triggered.
Attaches an action to be executed during a drag-and-drop operation to determine whether the drag should continue.
Returns: . The control with the attached QueryContinueDrag event action.
This method allows you to specify an action that will be executed when the control's QueryContinueDrag event is triggered.
Attaches an action to be executed when the control is resized.
Returns: . The control with the attached Resize event action.
This method allows you to specify an action that will be executed when the control's Resize event is triggered.
Attaches an action to be executed when the RightToLeft property of the control changes.
Returns: . The control with the attached RightToLeftChanged event action.
This method allows you to specify an action that will be executed when the control's RightToLeftChanged event is triggered.
Attaches an action to be executed when the Size property of the control changes.
Returns: . The control with the attached SizeChanged event action.
This method allows you to specify an action that will be executed when the control's SizeChanged event is triggered.
Attaches an action to be executed when the style of the control changes.
Returns: . The control with the attached StyleChanged event action.
This method allows you to specify an action that will be executed when the control's StyleChanged event is triggered.
Registers an action to be called when the event is raised.
Returns: . The control with the event handler registered.
This method allows you to easily attach a swipe event handler to a control.
Attaches an action to be executed when the TabIndex property of the control changes.
Returns: . The control with the attached TabIndexChanged event action.
This method allows you to specify an action that will be executed when the control's TabIndexChanged event is triggered.
Attaches an action to be executed when the TabStop property of the control changes.
Returns: . The control with the attached TabStopChanged event action.
This method allows you to specify an action that will be executed when the control's TabStopChanged event is triggered.
Attaches an action to be executed when the Text property of the control changes.
Returns: . The control with the attached TextChanged event action.
This method allows you to specify an action that will be executed when the control's TextChanged event is triggered.
Registers an action to be called when the event is raised.
Returns: . The control with the event handler registered.
This method allows you to easily attach a touch cancel event handler to a control.
Registers an action to be called when the event is raised.
Returns: . The control with the event handler registered.
This method allows you to easily attach a touch end event handler to a control.
Registers an action to be called when the event is raised.
Returns: . The control with the event handler registered.
This method allows you to easily attach a touch move event handler to a control.
Registers an action to be called when the event is raised.
Returns: . The control with the event handler registered.
This method allows you to easily attach a touch start event handler to a control.
Registers an action to be called when the event is raised.
Returns: . The control with the event handler registered.
This method allows you to easily attach a track event handler to a control.
Attaches an action to be executed when the control is successfully validated.
Returns: . The control with the attached Validated event action.
This method allows you to specify an action that will be executed when the control's Validated event is triggered.
Attaches an action to be executed when the Visible property of the control changes.
Returns: . The control with the attached VisibleChanged event action.
This method allows you to specify an action that will be executed when the control's VisibleChanged event is triggered.
Sets the padding for the specified control.
Returns: . The control with the updated padding.
Sets the padding for the specified control using an array of integers.
Returns: . The control with the updated padding.
This method allows setting the padding using different configurations of padding values.
Throws:
Thrown when the padding array is null.
Thrown when the padding array length is not 1, 2, or 4.
Sets the parent control for the specified control.
Returns: . The control with the updated parent.
Resets data bindings on the control.
Returns: . The control instance after resetting bindings.
This method resets all data bindings for the control, refreshing the data displayed.
Sets the RightToLeft property for the specified control, determining the direction of text and layout.
Returns: . The control with the updated RightToLeft property.
Scales the control by the specified factor.
Returns: . The control instance after scaling.
This method resizes the control by the specified scaling factor.
Scales the control by the specified ratio.
Returns: . The control instance after scaling.
This method resizes the control by the specified ratio, maintaining aspect ratio.
Scales the control by the specified horizontal and vertical factors.
Returns: . The control instance after scaling.
This method resizes the control by the specified horizontal and vertical scaling factors.
Scrolls the control into view within its parent container.
Returns: . The control instance after scrolling into view.
This method ensures that the control is visible within its parent container by scrolling as necessary.
Scrolls the control into view within its parent container, aligning it according to the specified horizontal and vertical alignment.
Returns: . The control instance after scrolling into view.
This method ensures that the control is visible within its parent container, aligning it according to the specified parameters.
Selects the control, optionally specifying the direction and focus behavior.
Returns: . The control instance after selection.
This method selects the control and can optionally direct focus to the next or previous control.
Returns: .
Sends the control to the back of the z-order.
Returns: . The control instance after being sent to the back.
This method changes the z-order of the control so that it appears behind all other controls.
Sets the bounds of the control to the specified location and size.
Returns: . The control instance after setting its bounds.
This method sets the position and size of the control within its parent container.
Sets the control's top-level status.
Returns: . The control instance after setting the top-level status.
This method sets whether the control is a top-level control.
Displays the control.
Returns: . The control instance after being shown.
This method makes the control visible.
Sets the size for the specified control using a object.
Returns: . The control with the updated size.
Sets the size for the specified control using width and height values.
Returns: . The control with the updated size.
Sets the tab index for the specified control, determining the order of focus when navigating with the Tab key.
Returns: . The control with the updated tab index.
Sets the TabStop property for the specified control, determining whether the control is included in the tab order.
Returns: . The control with the updated TabStop property.
Sets the tag for the specified control, allowing for the storage of additional data.
Returns: . The control with the updated tag.
Sets the text for the specified control.
Returns: . The control with the updated text.
Sends the control to the back of the z-order.
Returns: . The control after being sent to the back.
If the control does not have a parent at the time of invocation, it will be sent to the back once a parent is assigned.
Brings the control to the front of the z-order.
Returns: . The control after being brought to the front.
If the control does not have a parent at the time of invocation, it will be brought to the front once a parent is assigned.
Sets the top position for the specified control.
Returns: . The control with the updated top position.
Sets user-defined data for the specified control using a key-value pair.
Returns: . The control with the updated user data.
This method allows you to store custom data associated with the control using a dictionary-like structure.
Assigns dynamic user data properties to the specified control and returns the control instance.
Returns: . The same TControl instance with updated user data.
This extension method iterates through the properties of the values object and assigns each property and its value to the UserData dictionary of the specified control . The method then returns the modified control, allowing for fluent chaining.
Sets the UseWaitCursor property for the specified control, determining whether to use the wait cursor for the control and its children.
Returns: . The control with the updated UseWaitCursor property.
Attaches an action to be executed during the Validating event of the control, allowing for custom validation logic.
Returns: . The control with the attached Validating event action.
This method allows you to specify an action that will be executed when the control's Validating event is triggered.
Sets the visibility of the specified control.
Returns: . The control with the updated visibility.
Sets the width for the specified control.
Returns: . The control with the updated width.
width
The new width of the control.
height
The new height of the control.
args
An array of arguments to pass to the function.
width
The new width of the control.
height
The new height of the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the accessible description.
accessibleDescription
The description to be set for accessibility purposes.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the accessible name.
accessibleName
The name to be set for accessibility purposes.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the accessible role.
accessibleRole
The role to be set for accessibility purposes.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the AllowDrop property.
allowDrop
A boolean value indicating whether to allow drag-and-drop operations. Default is false.
TControl
The type of the control, which must inherit from Control.
control
The control on which the action is to be performed.
action
The action to be executed on the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the anchor styles.
anchors
The anchor styles to be applied to the control.
TControl
control
value
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the auto-scroll offset.
offset
The point representing the auto-scroll offset.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the AutoSize property.
autoSize
A boolean value indicating whether to enable automatic resizing. Default is false.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the background color.
color
The color to be set as the background color.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the background image.
image
The image to be set as the background image.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the background image layout.
layout
The layout to be applied to the background image.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the bounds.
bounds
The rectangle representing the new bounds of the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the top and left position.
top
The new top position of the control.
left
The new left position of the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the bounds.
top
The new top position of the control.
left
The new left position of the control.
TControl
The type of the control, constrained to Control.
control
The control instance to bring to the front.
TControl
The type of the control, constrained to Control.
control
The control instance on which to invoke the function.
function
The name of the function to call.
args
An array of arguments to pass to the function.
TControl
The type of the control, constrained to Control.
control
The control instance on which to invoke the function.
function
The name of the function to call.
callback
A callback to be executed with the result of the function call.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the capture property.
capture
A boolean value indicating whether the control should capture the mouse. Default is false.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the CausesValidation property.
causesValidation
A boolean value indicating whether the control causes validation. Default is true.
TControl
The type of the control, constrained to Control.
control
The control instance to center.
horizontal
If true, centers the control horizontally.
vertical
If true, centers the control vertically.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the client size.
clientSize
The size to be set as the client size of the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the context menu.
contextMenu
The context menu to be associated with the control.
TControl
The type of the control, which must inherit from Control.
control
The control to which the child controls will be added.
children
An array of child controls to be added.
TControl
The type of the control, constrained to Control.
control
The control instance to create.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the cursor.
cursor
The cursor to be used by the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the dock style.
dockPosition
The dock style to be applied to the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the enabled state.
enabled
A boolean value indicating whether the control should be enabled. Default is true.
TControl
The type of the control, constrained to Control.
control
The control instance on which to evaluate the JavaScript.
javaScript
The JavaScript code to evaluate.
callback
An optional callback to handle the result of the evaluation. Default is null.
TControl
control
value
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the font.
font
The font to be applied to the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the font size.
size
The new font size to be applied to the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the foreground color.
foreColor
The color to be set as the foreground color.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the height.
height
The new height to be applied to the control.
TControl
The type of the control, constrained to Control.
control
The control instance to hide.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the control loses focus.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the left position.
left
The new left position to be applied to the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the location.
location
The point representing the new location of the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the location.
left
The new left position of the control.
top
The new top position of the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the margin.
margin
The padding to be set as the margin of the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the margin.
padding
An array of integers representing the margin. Must be 1 (all), 2 (horizontal, vertical), or 4 (left, top, right, bottom).
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the maximum size.
width
height
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the maximum size.
size
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the minimum size.
size
The size to be set as the minimum size of the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the minimum size.
width
The minimum width of the control.
height
The minimum height of the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the name.
name
The name to be assigned to the control.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the AutoSize property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the BackColor property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the BackgroundImage property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the BackgroundImageLayout property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the BindingContext property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the CausesValidation property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the control is clicked.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the ClientSize property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the ContextMenu property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when a control is added, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when a control is removed, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the Cursor property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the Dock property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the control is double-clicked.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when a drag-and-drop operation is completed, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when an object is dragged into the control, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when an object is dragged out of the control.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when an object is dragged over the control, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the Enabled property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the control receives focus.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the Font property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the ForeColor property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the control receives focus.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the control's handle is created.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the control's handle is destroyed.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when a help request is made, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when a key is pressed, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when a key is pressed and released, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when a key is released, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the layout changes, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the Location property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the control loses focus.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the Margin property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the mouse capture changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the control is clicked, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the control is double-clicked, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when a mouse button is pressed, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the mouse pointer enters the control.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the mouse pointer hovers over the control.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the mouse pointer leaves the control.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the mouse pointer moves, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when a mouse button is released, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the mouse wheel is rotated, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the control is moved.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the Padding property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the control is repainted, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the Parent property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when a key is pressed, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed during the drag operation, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the control is resized.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the RightToLeft property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the Size property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the style changes.
TControl
The type of the control, which must inherit from Control.
control
The control on which to register the event handler.
action
The action to perform when the swipe event occurs.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the TabIndex property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the TabStop property changes.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the Text property changes.
TControl
The type of the control, which must inherit from Control.
control
The control on which to register the event handler.
action
The action to perform when the touch cancel event occurs.
TControl
The type of the control, which must inherit from Control.
control
The control on which to register the event handler.
action
The action to perform when the touch end event occurs.
TControl
The type of the control, which must inherit from Control.
control
The control on which to register the event handler.
action
The action to perform when the touch move event occurs.
TControl
The type of the control, which must inherit from Control.
control
The control on which to register the event handler.
action
The action to perform when the touch start event occurs.
TControl
The type of the control, which must inherit from Control.
control
The control on which to register the event handler.
action
The action to perform when the track event occurs.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the control is validated.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed when the Visible property changes.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the padding.
padding
The padding to be applied to the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the padding.
padding
An array of integers representing the padding. Must be 1 (all), 2 (horizontal, vertical), or 4 (left, top, right, bottom).
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the parent.
parent
The parent control to be assigned.
TControl
The type of the control, constrained to Control.
control
The control instance whose bindings are to be reset.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the RightToLeft property.
rtl
The RightToLeft value to be applied to the control.
TControl
The type of the control, constrained to Control.
control
The control instance to scale.
factor
The scaling factor as a SizeF structure.
TControl
The type of the control, constrained to Control.
control
The control instance to scale.
ratio
The scaling ratio as a Single.
TControl
The type of the control, constrained to Control.
control
The control instance to scale.
dx
The horizontal scaling factor.
dy
The vertical scaling factor.
TControl
The type of the control, constrained to Control.
control
The control instance to scroll into view.
TControl
The type of the control, constrained to Control.
control
The control instance to scroll into view.
alignX
The horizontal alignment to use.
alignY
The vertical alignment to use.
TControl
The type of the control, constrained to Control.
control
The control instance to select.
directed
Indicates whether to select the control in a directed manner.
forward
Indicates whether to select the next control in the forward direction.
TControl
control
value
TControl
The type of the control, constrained to Control.
control
The control instance to send to the back.
TControl
The type of the control, constrained to Control.
control
The control instance to modify.
x
The new x-coordinate of the control.
y
The new y-coordinate of the control.
TControl
The type of the control, constrained to Control.
control
The control instance to modify.
value
A boolean value indicating whether the control should be top-level.
TControl
The type of the control, constrained to Control.
control
The control instance to show.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the size.
size
The size to be applied to the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the size.
width
The width of the control.
height
The height of the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the tab index.
tabIndex
The tab index to be assigned to the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the TabStop property.
tabStop
A boolean value indicating whether the control is included in the tab order. Default is true.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the tag.
tag
The object to be stored as the tag.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the text.
text
The text to be displayed by the control.
TControl
The type of the control, which must inherit from Control.
control
The control to be sent to the back.
TControl
The type of the control, which must inherit from Control.
control
The control to be brought to the front.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the top position.
top
The new top position to be applied to the control.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the user data.
name
The key for the user data.
value
The value to be associated with the key.
TControl
The type of the control, which must inherit from Control.
control
The control to which user data properties will be assigned.
values
A dynamic object containing property names and values to be added to the control's user data.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the UseWaitCursor property.
useWait
A boolean value indicating whether to use the wait cursor. Default is false.
TControl
The type of the control, which must inherit from Control.
control
The control to which the action will be attached.
action
The action to be executed during validation, with the event arguments provided.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the visibility.
visible
A boolean value indicating whether the control should be visible. Default is true.
TControl
The type of the control, which must inherit from Control.
control
The control for which to set the width.
width
The new width to be applied to the control.
myControl.Also(c => c.Text = "Updated Text").BackColor(Color.Red);
myControl.Controls(new Button(), new TextBox());
myControl.Leave(c => AlertBox.Show($"{c.Name} lost focus"));
myControl.Margin(5); // All sides
myControl.Margin(5, 10); // Horizontal and vertical
myControl.Margin(5, 10, 15, 20); // Left, top, right, bottom
myControl.OnAutoSizeChanged(c => AlertBox.Show($"{c.Name} AutoSize changed"));
myControl.OnBackColorChanged(c => AlertBox.Show($"{c.Name} BackColor changed"));
myControl.OnBackgroundImageChanged(c => AlertBox.Show($"{c.Name} BackgroundImage changed"));
myControl.OnBackgroundImageLayoutChanged(c => AlertBox.Show($"{c.Name} BackgroundImageLayout changed"));
myControl.OnBindingContextChanged(c => AlertBox.Show($"{c.Name} BindingContext changed"));
myControl.OnCausesValidationChanged(c => AlertBox.Show($"{c.Name} CausesValidation changed"));
myControl.OnClick(c => AlertBox.Show($"{c.Name} was clicked"));
myControl.OnClientSizeChanged(c => AlertBox.Show($"{c.Name} ClientSize changed"));
myControl.OnContextMenuChanged(c => AlertBox.Show($"{c.Name} ContextMenu changed"));
myControl.OnControlAdded((c, args) => AlertBox.Show($"{args.Control.Name} was added to {c.Name}"));
myControl.OnControlRemoved((c, args) => AlertBox.Show($"{args.Control.Name} was removed from {c.Name}"));
myControl.OnCursorChanged(c => AlertBox.Show($"{c.Name} Cursor changed"));
myControl.OnDockChanged(c => AlertBox.Show($"{c.Name} Dock changed"));
myControl.OnDoubleClick(c => AlertBox.Show($"{c.Name} was double-clicked"));
myControl.OnDragDrop((c, args) => AlertBox.Show($"{c.Name} received a drag drop"));
myControl.OnDragEnter((c, args) => AlertBox.Show($"{c.Name} drag enter"));
myControl.OnDragLeave(c => AlertBox.Show($"{c.Name} drag leave"));
myControl.OnDragOver((c, args) => AlertBox.Show($"{c.Name} drag over"));
myControl.OnEnabledChanged(c => AlertBox.Show($"{c.Name} Enabled changed"));
myControl.OnEnter(c => AlertBox.Show($"{c.Name} received focus"));
myControl.OnFontChanged(c => AlertBox.Show($"{c.Name} Font changed"));
myControl.OnForeColorChanged(c => AlertBox.Show($"{c.Name} ForeColor changed"));
myControl.OnGotFocus(c => AlertBox.Show($"{c.Name} got focus"));
myControl.OnHandleCreated(c => AlertBox.Show($"{c.Name} handle created"));
myControl.OnHandleDestroyed(c => AlertBox.Show($"{c.Name} handle destroyed"));
myControl.OnHelpRequested((c, args) => AlertBox.Show($"{c.Name} help requested"));
myControl.OnKeyDown((c, args) => AlertBox.Show($"{c.Name} key down: {args.KeyCode}"));
myControl.OnKeyPress((c, args) => AlertBox.Show($"{c.Name} key press: {args.KeyChar}"));
myControl.OnKeyUp((c, args) => AlertBox.Show($"{c.Name} key up: {args.KeyCode}"));
myControl.OnLayout((c, args) => AlertBox.Show($"{c.Name} layout changed"));
myControl.OnLocationChanged(c => AlertBox.Show($"{c.Name} location changed"));
myControl.OnLostFocus(c => AlertBox.Show($"{c.Name} lost focus"));
myControl.OnMarginChanged(c => AlertBox.Show($"{c.Name} margin changed"));
myControl.OnMouseCaptureChanged(c => AlertBox.Show($"{c.Name} mouse capture changed"));
myControl.OnMouseClick((c, args) => AlertBox.Show($"{c.Name} mouse click at {args.Location}"));
myControl.OnMouseDoubleClick((c, args) => AlertBox.Show($"{c.Name} mouse double-click at {args.Location}"));
myControl.OnMouseDown((c, args) => AlertBox.Show($"{c.Name} mouse down at {args.Location}"));
myControl.OnMouseEnter(c => AlertBox.Show($"{c.Name} mouse entered"));
myControl.OnMouseHover(c => AlertBox.Show($"{c.Name} mouse hover"));
myControl.OnMouseLeave(c => AlertBox.Show($"{c.Name} mouse left"));
myControl.OnMouseMove((c, args) => AlertBox.Show($"{c.Name} mouse move at {args.Location}"));
myControl.OnMouseUp((c, args) => AlertBox.Show($"{c.Name} mouse up at {args.Location}"));
myControl.OnMouseWheel((c, args) => AlertBox.Show($"{c.Name} mouse wheel moved"));
myControl.OnMove(c => AlertBox.Show($"{c.Name} moved"));
myControl.OnPaddingChanged(c => AlertBox.Show($"{c.Name} padding changed"));
myControl.OnPaint((c, args) => AlertBox.Show($"{c.Name} is being painted"));
myControl.OnParentChanged(c => AlertBox.Show($"{c.Name} parent changed"));
myControl.OnPreviewKeyDown((c, args) => AlertBox.Show($"{c.Name} preview key down: {args.KeyCode}"));
myControl.OnQueryContinueDrag((c, args) => AlertBox.Show($"{c.Name} query continue drag"));
myControl.OnResize(c => AlertBox.Show($"{c.Name} resized"));
myControl.ONRightToLeftChanged(c => AlertBox.Show($"{c.Name} RightToLeft changed"));
myControl.OnSizeChanged(c => AlertBox.Show($"{c.Name} size changed"));
myControl.OnStyleChanged(c => AlertBox.Show($"{c.Name} style changed"));
myControl.OnSwipe((ctrl, args) => { /* Handle swipe */ });
myControl.OnTabIndexChanged(c => AlertBox.Show($"{c.Name} tab index changed"));
myControl.OnTabStopChanged(c => AlertBox.Show($"{c.Name} TabStop changed"));
myControl.OnTextChanged(c => AlertBox.Show($"{c.Name} text changed"));
myControl.OnTouchCancel((ctrl, args) => { /* Handle touch cancel */ });
myControl.OnTouchEnd((ctrl, args) => { /* Handle touch end */ });
myControl.OnTouchMove((ctrl, args) => { /* Handle touch move */ });
myControl.OnTouchStart((ctrl, args) => { /* Handle touch start */ });
myControl.OnTrack((ctrl, args) => { /* Handle track */ });
myControl.OnValidated(c => AlertBox.Show($"{c.Name} validated"));
myControl.OnVisibleChanged(c => AlertBox.Show($"{c.Name} visibility changed"));
myControl.Padding(5); // All sides
myControl.Padding(5, 10); // Horizontal and vertical
myControl.Padding(5, 10, 15, 20); // Left, top, right, bottom
myControl.ToBack();
myControl.ToFront();
var button = new Button();
button.UserData(new { MyName = "Save", IsPrimary = true });
myControl.Validating((c, args) => AlertBox.Show($"{c.Name} is validating"));