All pages
Powered by GitBook
1 of 1

Loading...

ControlExtensions

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 ControlExtensions
Public Class ControlExtensions

Methods

AccessibleDescription<TControl>(control, accessibleDescription)

Sets the accessible description for the specified control.

Parameter
Type
Description

Returns: . The control with the updated accessible description.

AccessibleName<TControl>(control, accessibleName)

Sets the accessible name for the specified control.

Parameter
Type
Description

Returns: . The control with the updated accessible name.

AccessibleRole<TControl>(control, accessibleRole)

Sets the accessible role for the specified control.

Parameter
Type
Description

Returns: . The control with the updated accessible role.

AllowDrop<TControl>(control, allowDrop)

Sets the AllowDrop property for the specified control, enabling or disabling drag-and-drop operations.

Parameter
Type
Description

Returns: . The control with the updated AllowDrop property.

Also<TControl>(control, action)

Executes a specified action on the control and returns the control.

Parameter
Type
Description

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.

Anchor<TControl>(control, anchors)

Sets the anchor styles for the specified control.

Parameter
Type
Description

Returns: . The control with the updated anchor styles.

Anonymous<TControl>(control, value)

Parameter
Type
Description

Returns: .

AutoScrollOffset<TControl>(control, offset)

Sets the auto-scroll offset for the specified control.

Parameter
Type
Description

Returns: . The control with the updated auto-scroll offset.

AutoSize<TControl>(control, autoSize)

Sets the AutoSize property for the specified control, enabling or disabling automatic resizing.

Parameter
Type
Description

Returns: . The control with the updated AutoSize property.

BackColor<TControl>(control, color)

Sets the background color for the specified control.

Parameter
Type
Description

Returns: . The control with the updated background color.

BackgroundImage<TControl>(control, image)

Sets the background image for the specified control.

Parameter
Type
Description

Returns: . The control with the updated background image.

BackgroundImageLayout<TControl>(control, layout)

Sets the layout of the background image for the specified control.

Parameter
Type
Description

Returns: . The control with the updated background image layout.

Bounds<TControl>(control, bounds)

Sets the bounds of the specified control using a .

Parameter
Type
Description

Returns: . The control with the updated bounds.

Bounds<TControl>(control, top, left)

Sets the top and left position of the specified control, maintaining its current width and height.

Parameter
Type
Description

Returns: . The control with the updated top and left position.

Bounds<TControl>(control, top, left, width, height)

Sets the bounds of the specified control using specified top, left, width, and height values.

Parameter
Type
Description

Returns: . The control with the updated bounds.

BringToFront<TControl>(control)

Brings the control to the front of the z-order.

Parameter
Type
Description

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.

Call<TControl>(control, function, args)

Invokes a specified JavaScript function on the control with the provided arguments.

Parameter
Type
Description

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.

Call<TControl>(control, function, callback, args)

Invokes a specified JavaScript function on the control with the provided arguments and a callback.

Parameter
Type
Description

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.

Capture<TControl>(control, capture)

Sets the capture property for the specified control, determining whether the control has captured the mouse.

Parameter
Type
Description

Returns: . The control with the updated capture property.

CausesValidation<TControl>(control, causesValidation)

Sets the CausesValidation property for the specified control, determining whether the control causes validation to be performed on any controls that require validation.

Parameter
Type
Description

Returns: . The control with the updated CausesValidation property.

CenterToParent<TControl>(control, horizontal, vertical)

Centers the control within its parent, optionally horizontally and/or vertically.

Parameter
Type
Description

Returns: . The control instance after centering.

This method centers the control within its parent container based on the specified axes.

ClientSize<TControl>(control, clientSize)

Sets the client size for the specified control.

Parameter
Type
Description

Returns: . The control with the updated client size.

ContextMenu<TControl>(control, contextMenu)

Sets the context menu for the specified control.

Parameter
Type
Description

Returns: . The control with the updated context menu.

Controls<TControl>(control, children)

Adds an array of child controls to the specified control.

Parameter
Type
Description

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.

CreateControl<TControl>(control)

Forces the creation of the control and its handle.

Parameter
Type
Description

Returns: . The control instance after creation.

This method ensures that the control and its underlying handle are created.

Cursor<TControl>(control, cursor)

Sets the cursor for the specified control.

Parameter
Type
Description

Returns: . The control with the updated cursor.

Dock<TControl>(control, dockPosition)

Sets the dock style for the specified control.

Parameter
Type
Description

Returns: . The control with the updated dock style.

Enabled<TControl>(control, enabled)

Sets the enabled state for the specified control.

Parameter
Type
Description

Returns: . The control with the updated enabled state.

Eval<TControl>(control, javaScript, callback)

Evaluates the specified JavaScript code in the context of the control, optionally with a callback.

Parameter
Type
Description

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.

Focusable<TControl>(control, value)

Parameter
Type
Description

Returns: .

Font<TControl>(control, font)

Sets the font for the specified control.

Parameter
Type
Description

Returns: . The control with the updated font.

FontSize<TControl>(control, size)

Sets the font size for the specified control while maintaining the current font family.

Parameter
Type
Description

Returns: . The control with the updated font size.

ForeColor<TControl>(control, foreColor)

Sets the foreground color for the specified control.

Parameter
Type
Description

Returns: . The control with the updated foreground color.

Height<TControl>(control, height)

Sets the height for the specified control.

Parameter
Type
Description

Returns: . The control with the updated height.

Hide<TControl>(control)

Hides the control.

Parameter
Type
Description

Returns: . The control instance after being hidden.

This method makes the control invisible.

Leave<TControl>(control, action)

Attaches an action to be executed when the control loses focus.

Parameter
Type
Description

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.

Left<TControl>(control, left)

Sets the left position for the specified control.

Parameter
Type
Description

Returns: . The control with the updated left position.

Location<TControl>(control, location)

Sets the location for the specified control.

Parameter
Type
Description

Returns: . The control with the updated location.

Location<TControl>(control, left, top)

Sets the location for the specified control using left and top coordinates.

Parameter
Type
Description

Returns: . The control with the updated location.

Margin<TControl>(control, margin)

Sets the margin for the specified control using a object.

Parameter
Type
Description

Returns: . The control with the updated margin.

Margin<TControl>(control, padding)

Sets the margin for the specified control using an array of integers.

Parameter
Type
Description

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.

MaximumSize<TControl>(control, width, height)

Sets the maximum size for the specified control using a object.

Parameter
Type
Description

Returns: . The control with the updated maximum size.

MaximumSize<TControl>(control, size)

Sets the maximum size for the specified control using width and height values.

Parameter
Type
Description

Returns: . The control with the updated maximum size.

MinimumSize<TControl>(control, size)

Sets the minimum size for the specified control using a object.

Parameter
Type
Description

Returns: . The control with the updated minimum size.

MinimumSize<TControl>(control, width, height)

Sets the minimum size for the specified control using width and height values.

Parameter
Type
Description

Returns: . The control with the updated minimum size.

Name<TControl>(control, name)

Sets the name for the specified control.

Parameter
Type
Description

Returns: . The control with the updated name.

OnAutoSizeChanged<TControl>(control, action)

Attaches an action to be executed when the AutoSize property of the control changes.

Parameter
Type
Description

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.

OnBackColorChanged<TControl>(control, action)

Attaches an action to be executed when the BackColor property of the control changes.

Parameter
Type
Description

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.

OnBackgroundImageChanged<TControl>(control, action)

Attaches an action to be executed when the BackgroundImage property of the control changes.

Parameter
Type
Description

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.

OnBackgroundImageLayoutChanged<TControl>(control, action)

Attaches an action to be executed when the BackgroundImageLayout property of the control changes.

Parameter
Type
Description

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.

OnBindingContextChanged<TControl>(control, action)

Attaches an action to be executed when the BindingContext property of the control changes.

Parameter
Type
Description

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.

OnCausesValidationChanged<TControl>(control, action)

Attaches an action to be executed when the CausesValidation property of the control changes.

Parameter
Type
Description

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.

OnClick<TControl>(control, action)

Attaches an action to be executed when the control is clicked.

Parameter
Type
Description

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.

OnClientSizeChanged<TControl>(control, action)

Attaches an action to be executed when the ClientSize property of the control changes.

Parameter
Type
Description

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.

OnContextMenuChanged<TControl>(control, action)

Attaches an action to be executed when the ContextMenu property of the control changes.

Parameter
Type
Description

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.

OnControlAdded<TControl>(control, action)

Attaches an action to be executed when a control is added to the control's collection.

Parameter
Type
Description

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.

OnControlRemoved<TControl>(control, action)

Attaches an action to be executed when a control is removed from the control's collection.

Parameter
Type
Description

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.

OnCursorChanged<TControl>(control, action)

Attaches an action to be executed when the Cursor property of the control changes.

Parameter
Type
Description

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.

OnDockChanged<TControl>(control, action)

Attaches an action to be executed when the Dock property of the control changes.

Parameter
Type
Description

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.

OnDoubleClick<TControl>(control, action)

Attaches an action to be executed when the control is double-clicked.

Parameter
Type
Description

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.

OnDragDrop<TControl>(control, action)

Attaches an action to be executed when a drag-and-drop operation is completed on the control.

Parameter
Type
Description

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.

OnDragEnter<TControl>(control, action)

Attaches an action to be executed when an object is dragged into the control's bounds.

Parameter
Type
Description

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.

OnDragLeave<TControl>(control, action)

Attaches an action to be executed when an object is dragged out of the control's bounds.

Parameter
Type
Description

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.

OnDragOver<TControl>(control, action)

Attaches an action to be executed when an object is dragged over the control's bounds.

Parameter
Type
Description

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.

OnEnabledChanged<TControl>(control, action)

Attaches an action to be executed when the Enabled property of the control changes.

Parameter
Type
Description

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.

OnEnter<TControl>(control, action)

Attaches an action to be executed when the control receives focus.

Parameter
Type
Description

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.

OnFontChanged<TControl>(control, action)

Attaches an action to be executed when the Font property of the control changes.

Parameter
Type
Description

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.

OnForeColorChanged<TControl>(control, action)

Attaches an action to be executed when the ForeColor property of the control changes.

Parameter
Type
Description

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.

OnGotFocus<TControl>(control, action)

Attaches an action to be executed when the control receives focus.

Parameter
Type
Description

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.

OnHandleCreated<TControl>(control, action)

Attaches an action to be executed when the control's handle is created.

Parameter
Type
Description

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.

OnHandleDestroyed<TControl>(control, action)

Attaches an action to be executed when the control's handle is destroyed.

Parameter
Type
Description

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.

OnHelpRequested<TControl>(control, action)

Attaches an action to be executed when a help request is made for the control.

Parameter
Type
Description

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.

OnKeyDown<TControl>(control, action)

Attaches an action to be executed when a key is pressed while the control has focus.

Parameter
Type
Description

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.

OnKeyPress<TControl>(control, action)

Attaches an action to be executed when a key is pressed and released while the control has focus.

Parameter
Type
Description

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.

OnKeyUp<TControl>(control, action)

Attaches an action to be executed when a key is released while the control has focus.

Parameter
Type
Description

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.

OnLayout<TControl>(control, action)

Attaches an action to be executed when the layout of the control is changed.

Parameter
Type
Description

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.

OnLocationChanged<TControl>(control, action)

Attaches an action to be executed when the Location property of the control changes.

Parameter
Type
Description

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.

OnLostFocus<TControl>(control, action)

Attaches an action to be executed when the control loses focus.

Parameter
Type
Description

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.

OnMarginChanged<TControl>(control, action)

Attaches an action to be executed when the Margin property of the control changes.

Parameter
Type
Description

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.

OnMouseCaptureChanged<TControl>(control, action)

Attaches an action to be executed when the mouse capture changes for the control.

Parameter
Type
Description

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.

OnMouseClick<TControl>(control, action)

Attaches an action to be executed when the control is clicked with the mouse.

Parameter
Type
Description

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.

OnMouseDoubleClick<TControl>(control, action)

Attaches an action to be executed when the control is double-clicked with the mouse.

Parameter
Type
Description

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.

OnMouseDown<TControl>(control, action)

Attaches an action to be executed when a mouse button is pressed while the pointer is over the control.

Parameter
Type
Description

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.

OnMouseEnter<TControl>(control, action)

Attaches an action to be executed when the mouse pointer enters the control's bounds.

Parameter
Type
Description

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.

OnMouseHover<TControl>(control, action)

Attaches an action to be executed when the mouse pointer hovers over the control.

Parameter
Type
Description

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.

OnMouseLeave<TControl>(control, action)

Attaches an action to be executed when the mouse pointer leaves the control's bounds.

Parameter
Type
Description

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.

OnMouseMove<TControl>(control, action)

Attaches an action to be executed when the mouse pointer moves over the control.

Parameter
Type
Description

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.

OnMouseUp<TControl>(control, action)

Attaches an action to be executed when a mouse button is released while the pointer is over the control.

Parameter
Type
Description

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.

OnMouseWheel<TControl>(control, action)

Attaches an action to be executed when the mouse wheel is rotated while the pointer is over the control.

Parameter
Type
Description

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.

OnMove<TControl>(control, action)

Attaches an action to be executed when the control is moved.

Parameter
Type
Description

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.

OnPaddingChanged<TControl>(control, action)

Attaches an action to be executed when the Padding property of the control changes.

Parameter
Type
Description

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.

OnPaint<TControl>(control, action)

Attaches an action to be executed when the control is repainted.

Parameter
Type
Description

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.

OnParentChanged<TControl>(control, action)

Attaches an action to be executed when the Parent property of the control changes.

Parameter
Type
Description

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.

OnPreviewKeyDown<TControl>(control, action)

Attaches an action to be executed when a key is pressed while the control has focus, before the key event is processed.

Parameter
Type
Description

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.

OnQueryContinueDrag<TControl>(control, action)

Attaches an action to be executed during a drag-and-drop operation to determine whether the drag should continue.

Parameter
Type
Description

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.

OnResize<TControl>(control, action)

Attaches an action to be executed when the control is resized.

Parameter
Type
Description

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.

ONRightToLeftChanged<TControl>(control, action)

Attaches an action to be executed when the RightToLeft property of the control changes.

Parameter
Type
Description

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.

OnSizeChanged<TControl>(control, action)

Attaches an action to be executed when the Size property of the control changes.

Parameter
Type
Description

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.

OnStyleChanged<TControl>(control, action)

Attaches an action to be executed when the style of the control changes.

Parameter
Type
Description

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.

OnSwipe<TControl>(control, action)

Registers an action to be called when the event is raised.

Parameter
Type
Description

Returns: . The control with the event handler registered.

This method allows you to easily attach a swipe event handler to a control.

OnTabIndexChanged<TControl>(control, action)

Attaches an action to be executed when the TabIndex property of the control changes.

Parameter
Type
Description

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.

OnTabStopChanged<TControl>(control, action)

Attaches an action to be executed when the TabStop property of the control changes.

Parameter
Type
Description

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.

OnTextChanged<TControl>(control, action)

Attaches an action to be executed when the Text property of the control changes.

Parameter
Type
Description

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.

OnTouchCancel<TControl>(control, action)

Registers an action to be called when the event is raised.

Parameter
Type
Description

Returns: . The control with the event handler registered.

This method allows you to easily attach a touch cancel event handler to a control.

OnTouchEnd<TControl>(control, action)

Registers an action to be called when the event is raised.

Parameter
Type
Description

Returns: . The control with the event handler registered.

This method allows you to easily attach a touch end event handler to a control.

OnTouchMove<TControl>(control, action)

Registers an action to be called when the event is raised.

Parameter
Type
Description

Returns: . The control with the event handler registered.

This method allows you to easily attach a touch move event handler to a control.

OnTouchStart<TControl>(control, action)

Registers an action to be called when the event is raised.

Parameter
Type
Description

Returns: . The control with the event handler registered.

This method allows you to easily attach a touch start event handler to a control.

OnTrack<TControl>(control, action)

Registers an action to be called when the event is raised.

Parameter
Type
Description

Returns: . The control with the event handler registered.

This method allows you to easily attach a track event handler to a control.

OnValidated<TControl>(control, action)

Attaches an action to be executed when the control is successfully validated.

Parameter
Type
Description

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.

OnVisibleChanged<TControl>(control, action)

Attaches an action to be executed when the Visible property of the control changes.

Parameter
Type
Description

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.

Padding<TControl>(control, padding)

Sets the padding for the specified control.

Parameter
Type
Description

Returns: . The control with the updated padding.

Padding<TControl>(control, padding)

Sets the padding for the specified control using an array of integers.

Parameter
Type
Description

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.

Parent<TControl>(control, parent)

Sets the parent control for the specified control.

Parameter
Type
Description

Returns: . The control with the updated parent.

ResetBindings<TControl>(control)

Resets data bindings on the control.

Parameter
Type
Description

Returns: . The control instance after resetting bindings.

This method resets all data bindings for the control, refreshing the data displayed.

RightToLeft<TControl>(control, rtl)

Sets the RightToLeft property for the specified control, determining the direction of text and layout.

Parameter
Type
Description

Returns: . The control with the updated RightToLeft property.

Scale<TControl>(control, factor)

Scales the control by the specified factor.

Parameter
Type
Description

Returns: . The control instance after scaling.

This method resizes the control by the specified scaling factor.

Scale<TControl>(control, ratio)

Scales the control by the specified ratio.

Parameter
Type
Description

Returns: . The control instance after scaling.

This method resizes the control by the specified ratio, maintaining aspect ratio.

Scale<TControl>(control, dx, dy)

Scales the control by the specified horizontal and vertical factors.

Parameter
Type
Description

Returns: . The control instance after scaling.

This method resizes the control by the specified horizontal and vertical scaling factors.

ScrollControlIntoView<TControl>(control)

Scrolls the control into view within its parent container.

Parameter
Type
Description

Returns: . The control instance after scrolling into view.

This method ensures that the control is visible within its parent container by scrolling as necessary.

ScrollControlIntoView<TControl>(control, alignX, alignY)

Scrolls the control into view within its parent container, aligning it according to the specified horizontal and vertical alignment.

Parameter
Type
Description

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.

Select<TControl>(control, directed, forward)

Selects the control, optionally specifying the direction and focus behavior.

Parameter
Type
Description

Returns: . The control instance after selection.

This method selects the control and can optionally direct focus to the next or previous control.

Selectable<TControl>(control, value)

Parameter
Type
Description

Returns: .

SendToBack<TControl>(control)

Sends the control to the back of the z-order.

Parameter
Type
Description

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.

SetBounds<TControl>(control, x, y, width, height)

Sets the bounds of the control to the specified location and size.

Parameter
Type
Description

Returns: . The control instance after setting its bounds.

This method sets the position and size of the control within its parent container.

SetTopLevel<TControl>(control, value)

Sets the control's top-level status.

Parameter
Type
Description

Returns: . The control instance after setting the top-level status.

This method sets whether the control is a top-level control.

Show<TControl>(control)

Displays the control.

Parameter
Type
Description

Returns: . The control instance after being shown.

This method makes the control visible.

Size<TControl>(control, size)

Sets the size for the specified control using a object.

Parameter
Type
Description

Returns: . The control with the updated size.

Size<TControl>(control, width, height)

Sets the size for the specified control using width and height values.

Parameter
Type
Description

Returns: . The control with the updated size.

TabIndex<TControl>(control, tabIndex)

Sets the tab index for the specified control, determining the order of focus when navigating with the Tab key.

Parameter
Type
Description

Returns: . The control with the updated tab index.

TabStop<TControl>(control, tabStop)

Sets the TabStop property for the specified control, determining whether the control is included in the tab order.

Parameter
Type
Description

Returns: . The control with the updated TabStop property.

Tag<TControl>(control, tag)

Sets the tag for the specified control, allowing for the storage of additional data.

Parameter
Type
Description

Returns: . The control with the updated tag.

Text<TControl>(control, text)

Sets the text for the specified control.

Parameter
Type
Description

Returns: . The control with the updated text.

ToBack<TControl>(control)

Sends the control to the back of the z-order.

Parameter
Type
Description

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.

ToFront<TControl>(control)

Brings the control to the front of the z-order.

Parameter
Type
Description

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.

Top<TControl>(control, top)

Sets the top position for the specified control.

Parameter
Type
Description

Returns: . The control with the updated top position.

UserData<TControl>(control, name, value)

Sets user-defined data for the specified control using a key-value pair.

Parameter
Type
Description

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.

UserData<TControl>(control, values)

Assigns dynamic user data properties to the specified control and returns the control instance.

Parameter
Type
Description

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.

UseWaitCursor<TControl>(control, useWait)

Sets the UseWaitCursor property for the specified control, determining whether to use the wait cursor for the control and its children.

Parameter
Type
Description

Returns: . The control with the updated UseWaitCursor property.

Validating<TControl>(control, action)

Attaches an action to be executed during the Validating event of the control, allowing for custom validation logic.

Parameter
Type
Description

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.

Visible<TControl>(control, visible)

Sets the visibility of the specified control.

Parameter
Type
Description

Returns: . The control with the updated visibility.

Width<TControl>(control, width)

Sets the width for the specified control.

Parameter
Type
Description

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

TControl

The control for which to set the accessible description.

accessibleDescription

String

The description to be set for accessibility purposes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the accessible name.

accessibleName

String

The name to be set for accessibility purposes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the accessible role.

accessibleRole

AccessibleRole

The role to be set for accessibility purposes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the AllowDrop property.

allowDrop

Boolean

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

TControl

The control on which the action is to be performed.

action

Action<TControl>

The action to be executed on the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the anchor styles.

anchors

AnchorStyles

The anchor styles to be applied to the control.

TControl

control

TControl

value

Boolean

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the auto-scroll offset.

offset

Point

The point representing the auto-scroll offset.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the AutoSize property.

autoSize

Boolean

A boolean value indicating whether to enable automatic resizing. Default is false.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the background color.

color

Color

The color to be set as the background color.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the background image.

image

Image

The image to be set as the background image.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the background image layout.

layout

ImageLayout

The layout to be applied to the background image.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the bounds.

bounds

Rectangle

The rectangle representing the new bounds of the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the top and left position.

top

Int32

The new top position of the control.

left

Int32

The new left position of the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the bounds.

top

Int32

The new top position of the control.

left

Int32

The new left position of the control.

TControl

The type of the control, constrained to Control.

control

TControl

The control instance to bring to the front.

TControl

The type of the control, constrained to Control.

control

TControl

The control instance on which to invoke the function.

function

String

The name of the function to call.

args

Object[]

An array of arguments to pass to the function.

TControl

The type of the control, constrained to Control.

control

TControl

The control instance on which to invoke the function.

function

String

The name of the function to call.

callback

Action<Object>

A callback to be executed with the result of the function call.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the capture property.

capture

Boolean

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

TControl

The control for which to set the CausesValidation property.

causesValidation

Boolean

A boolean value indicating whether the control causes validation. Default is true.

TControl

The type of the control, constrained to Control.

control

TControl

The control instance to center.

horizontal

Boolean

If true, centers the control horizontally.

vertical

Boolean

If true, centers the control vertically.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the client size.

clientSize

Size

The size to be set as the client size of the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the context menu.

contextMenu

ContextMenu

The context menu to be associated with the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the child controls will be added.

children

Control[]

An array of child controls to be added.

TControl

The type of the control, constrained to Control.

control

TControl

The control instance to create.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the cursor.

cursor

Cursor

The cursor to be used by the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the dock style.

dockPosition

DockStyle

The dock style to be applied to the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the enabled state.

enabled

Boolean

A boolean value indicating whether the control should be enabled. Default is true.

TControl

The type of the control, constrained to Control.

control

TControl

The control instance on which to evaluate the JavaScript.

javaScript

String

The JavaScript code to evaluate.

callback

Action<Object>

An optional callback to handle the result of the evaluation. Default is null.

TControl

control

TControl

value

Boolean

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the font.

font

Font

The font to be applied to the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the font size.

size

Int32

The new font size to be applied to the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the foreground color.

foreColor

Color

The color to be set as the foreground color.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the height.

height

Int32

The new height to be applied to the control.

TControl

The type of the control, constrained to Control.

control

TControl

The control instance to hide.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the control loses focus.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the left position.

left

Int32

The new left position to be applied to the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the location.

location

Point

The point representing the new location of the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the location.

left

Int32

The new left position of the control.

top

Int32

The new top position of the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the margin.

margin

Padding

The padding to be set as the margin of the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the margin.

padding

Int32[]

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

TControl

The control for which to set the maximum size.

width

Int32

height

Int32

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the maximum size.

size

Size

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the minimum size.

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

TControl

The control for which to set the minimum size.

width

Int32

The minimum width of the control.

height

Int32

The minimum height of the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the name.

name

String

The name to be assigned to the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the AutoSize property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the BackColor property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the BackgroundImage property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the BackgroundImageLayout property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the BindingContext property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the CausesValidation property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the control is clicked.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the ClientSize property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the ContextMenu property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl, ControlEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl, ControlEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the Cursor property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the Dock property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the control is double-clicked.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl, DragEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl, DragEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl>

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

TControl

The control to which the action will be attached.

action

Action<TControl, DragEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the Enabled property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the control receives focus.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the Font property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the ForeColor property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the control receives focus.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the control's handle is created.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the control's handle is destroyed.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl, HelpEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl, KeyEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl, KeyPressEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl, KeyEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl, LayoutEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the Location property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the control loses focus.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the Margin property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the mouse capture changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl, MouseEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl, MouseEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl, MouseEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the mouse pointer enters the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

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

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the mouse pointer leaves the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl, MouseEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl, MouseEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl, MouseEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the control is moved.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the Padding property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl, PaintEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the Parent property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl, PreviewKeyDownEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl, QueryContinueDragEventArgs>

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

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the control is resized.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the RightToLeft property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the Size property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the style changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control on which to register the event handler.

action

Action<TControl, SwipeEventArgs>

The action to perform when the swipe event occurs.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the TabIndex property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the TabStop property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the Text property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control on which to register the event handler.

action

Action<TControl, TouchEventArgs>

The action to perform when the touch cancel event occurs.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control on which to register the event handler.

action

Action<TControl, TouchEventArgs>

The action to perform when the touch end event occurs.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control on which to register the event handler.

action

Action<TControl, TouchEventArgs>

The action to perform when the touch move event occurs.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control on which to register the event handler.

action

Action<TControl, TouchEventArgs>

The action to perform when the touch start event occurs.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control on which to register the event handler.

action

Action<TControl, TrackEventArgs>

The action to perform when the track event occurs.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the control is validated.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which the action will be attached.

action

Action<TControl>

The action to be executed when the Visible property changes.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the padding.

padding

Padding

The padding to be applied to the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the padding.

padding

Int32[]

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

TControl

The control for which to set the parent.

parent

Control

The parent control to be assigned.

TControl

The type of the control, constrained to Control.

control

TControl

The control instance whose bindings are to be reset.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the RightToLeft property.

rtl

RightToLeft

The RightToLeft value to be applied to the control.

TControl

The type of the control, constrained to Control.

control

TControl

The control instance to scale.

factor

SizeF

The scaling factor as a SizeF structure.

TControl

The type of the control, constrained to Control.

control

TControl

The control instance to scale.

ratio

Single

The scaling ratio as a Single.

TControl

The type of the control, constrained to Control.

control

TControl

The control instance to scale.

dx

Single

The horizontal scaling factor.

dy

Single

The vertical scaling factor.

TControl

The type of the control, constrained to Control.

control

TControl

The control instance to scroll into view.

TControl

The type of the control, constrained to Control.

control

TControl

The control instance to scroll into view.

alignX

HorizontalAlignment

The horizontal alignment to use.

alignY

VerticalAlignment

The vertical alignment to use.

TControl

The type of the control, constrained to Control.

control

TControl

The control instance to select.

directed

Boolean

Indicates whether to select the control in a directed manner.

forward

Boolean

Indicates whether to select the next control in the forward direction.

TControl

control

TControl

value

Boolean

TControl

The type of the control, constrained to Control.

control

TControl

The control instance to send to the back.

TControl

The type of the control, constrained to Control.

control

TControl

The control instance to modify.

x

Int32

The new x-coordinate of the control.

y

Int32

The new y-coordinate of the control.

TControl

The type of the control, constrained to Control.

control

TControl

The control instance to modify.

value

Boolean

A boolean value indicating whether the control should be top-level.

TControl

The type of the control, constrained to Control.

control

TControl

The control instance to show.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the size.

size

Size

The size to be applied to the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the size.

width

Int32

The width of the control.

height

Int32

The height of the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the tab index.

tabIndex

Int32

The tab index to be assigned to the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the TabStop property.

tabStop

Boolean

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

TControl

The control for which to set the tag.

tag

Object

The object to be stored as the tag.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the text.

text

String

The text to be displayed by the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to be sent to the back.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to be brought to the front.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the top position.

top

Int32

The new top position to be applied to the control.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the user data.

name

String

The key for the user data.

value

Object

The value to be associated with the key.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control to which user data properties will be assigned.

values

Object

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

TControl

The control for which to set the UseWaitCursor property.

useWait

Boolean

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

TControl

The control to which the action will be attached.

action

Action<TControl, CancelEventArgs>

The action to be executed during validation, with the event arguments provided.

TControl

The type of the control, which must inherit from Control.

control

TControl

The control for which to set the visibility.

visible

Boolean

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

TControl

The control for which to set the width.

width

Int32

The new width to be applied to the control.

TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
Rectangle
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
Fill
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
Padding
TControl
TControl
ArgumentNullException
ArgumentException
Size
TControl
TControl
Size
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
Swipe
TControl
TControl
TControl
TControl
TouchCancel
TControl
TouchEnd
TControl
TouchMove
TControl
TouchStart
TControl
Track
TControl
TControl
TControl
TControl
TControl
ArgumentNullException
ArgumentException
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
Size
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl
TControl

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"));
Int32
Int32
Object[]
Int32
Int32