Class Control
Defines the base class for controls, which are components with visual representation.
public class Control : FrameworkElement, IBaseObject, IDisposableObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, IControl, IDisposable, IWin32Window, INotifyDataErrorInfo
- Inheritance
-
Control
- Implements
- Derived
Constructors
Fields
- MinElementSize
Gets or sets min element size.
- UseDebugBackgroundColor
Gets or sets whether DebugBackgroundColor(Color?, string?) property is used.
Properties
- AbsolutePosition
Gets absolute position of the control. Returned value is Location plus all control's parents locations.
- AllChildren
Gets Children or an empty array if there are no child controls.
- AllChildrenInLayout
Gets all child controls which are visible and included in the layout.
- AllParents
Enumerates all parent controls.
- AllowDrop
Gets or sets a value indicating whether the control can accept data that the user drags onto it.
- BackColor
Gets or sets the background color for the control.
- Background
Gets or sets the background brush for the control.
- BackgroundColor
Gets or sets the background color for the control.
- BackgroundImage
Gets or sets the background image displayed in the control.
- BackgroundImages
Gets or sets background images attached to this control.
- BackgroundStyle
Gets or sets the background style of the control.
- Backgrounds
Gets or sets background brushes attached to this control.
- BindScrollEvents
Gets or sets whether scroll events are binded and recveived in the control.
- BorderStyle
Gets or sets border style of the control.
- Borders
Gets or sets border for all states of the control.
- Bottom
Gets the distance, in dips, between the bottom edge of the control and the top edge of its container's client area.
- CanFocus
Gets or sets a value indicating whether the control can receive focus.
- CanSelect
Gets or sets value indicating whether this control accepts input or not (i.e. behaves like a static text) and so doesn't need focus.
- CanUserPaint
Gets whether user paint is supported for this control.
- ChildCount
Gets number of children items.
- Children
Gets the collection of child controls contained within the control.
- ChildrenLayoutBounds
Gets a rectangle which describes an area inside of the Control available for positioning (layout) of its child controls, in device-independent units.
- ChildrenSet
Returns ControlSet filled with Children.
- ClientRectangle
Gets a rectangle which describes the client area inside of the Control, in device-independent units.
- ClientSize
Gets or sets size of the Control's client area, in device-independent units.
- ColumnIndex
Gets or sets column index which is used in GetColumnGroup(int, bool) and by the Grid control.
- ColumnSpan
Gets or sets a value that indicates the total number of columns this control's content spans within a container.
- ContainsFocus
Gets a value indicating whether the control, or one of its child controls, currently has the input focus.
- ContextMenuStrip
Gets or sets the ContextMenuStrip associated with this control.
- ControlKind
Returns control identifier.
- Cursor
Gets or sets the cursor that the control should normally display.
- CustomAttr
Gets custom attributes provider associated with the control. You can store any custom data here.
- CustomFlags
Gets custom flags provider associated with the control. You can store any custom flags here.
- DPI
Gets the DPI of the display used by this control. Returns width property of the result of GetDPI() call.
- DefaultBackColor
Gets the default background color of the control.
- DefaultFont
Gets the default font used for controls.
- DefaultForeColor
Gets the default foreground color of the control.
- DefaultMonoFont
Gets the default fixed width font used for controls.
- Designer
Gets or sets IComponentDesigner instance which connects control with the designer.
- Dock
Gets or sets which control borders are docked to its parent control and determines how a control is resized with its parent.
- DrawClientRectangle
Returns rectangle in which custom drawing need to be performed. Useful for custom draw controls
- Enabled
Gets or sets a value indicating whether the control can respond to user interaction.
- FileSystem
Gets or sets IFileSystem which is used in the control. If this property is
null
(default), Default is used as file system provider.
- FirstChild
Gets the first child of the control if it exists or
null
otherwise.
- FlagsAndAttributes
Gets or sets custom flags and attributes provider associated with the control. You can store any custom data here.
- Focused
Gets a value indicating whether the control has input focus.
- FocusedControl
Gets or sets focused control for internal purposes. Use GetFocusedControl() instead of this property.
- Font
Gets or sets the font of the text displayed by the control.
- ForeColor
Gets or sets the foreground color for the control.
- Foreground
Gets or sets the foreground brush for the control.
- ForegroundColor
Gets or sets the foreground color for the control.
- Foregrounds
Gets or sets foreground brushes attached to this control.
- GlobalNotifications
Gets global collection of the attached IControlNotification objects. These notifications are called for the each created control.
- GroupIndex
Gets or sets group indexes of this control. Group indexes are used in GetGroup(int, bool) method.
- GroupIndexes
Gets or sets group indexes which are assigned to this control.
- Handler
Gets a IControlHandler associated with this class.
- HasChildren
Gets whether there are any items in the Children list.
- HasErrors
Gets a value that indicates whether this control or its child controls have validation errors.
- Height
Gets or sets the height of the control.
- HorizontalAlignment
Gets or sets the horizontal alignment applied to this control when it is positioned within a parent control.
- HorzScrollBarInfo
Gets or sets horizontal scrollbar position as ScrollBarInfo.
- HoveredControl
Gets hovered control.
- IgnoreLayout
Gets or sets whether layout rules are ignored for this control.
- ImeMode
Gets or sets the Input Method Editor (IME) mode of the control.
- InUpdates
Gets whether control is performing updates.
- IndexInParent
Gets control index in the Children of the container control.
- InitAction
Executes assigned action immediately.
- InputTransparent
Gets or sets a value indicating whether this element responds to hit testing during user interaction.
- IntAttr
Gets attributes provider which allows to access items using integer identifiers. You can store any custom data here.
- IntFlags
Gets flags provider which allows to access items using integer identifiers. You can store any custom flags here.
- IntFlagsAndAttributes
Gets or sets flags and attributes provider which allows to access items using integer identifiers. You can store any custom data here.
- IntrinsicLayoutPadding
Gets intrinsic layout padding of the native control.
- IntrinsicPreferredSizePadding
Gets intrinsic preferred size padding of the native control.
- IsBold
Gets or sets whether control's font is bold.
- IsDarkBackground
Returns true if control's background color is darker than foreground color.
- IsDummy
Gets whether this control is dummy control.
- IsGraphicControl
Gets whether control is graphic control. Graphic controls can not be selected using mouse, do not accept focus and ignore keyboard.
- IsHandleCreated
Gets a value indicating whether the control has a native window handle associated with it.
- IsLayoutPerform
Gets whether layout is currently performed.
- IsLayoutSuspended
Gets whether layout is suspended.
- IsMouseCaptured
Gets a value indicating whether the mouse is captured to this control.
- IsMouseLeftButtonDown
Gets whether left mouse button is over control and is down.
- IsMouseOver
Gets a value indicating whether the mouse pointer is over the Control.
- IsParentEnabled
Gets a value indicating whether Parent of this control can respond to user interaction.
- IsScrollable
Gets or sets whether controls is scrollable.
- IsTextLocalized
Gets or sets whether Text property should be localizable.
- IsThisEnabled
Gets or sets a value indicating whether the control is intrinsically enabled.
- IsTitleLocalized
Gets or sets whether Title property should be localizable.
- IsToolTipLocalized
Gets or sets whether ToolTip property should be localizable.
- KeyModifiers
Gets a value indicating which of the modifier keys (SHIFT, CTRL, and ALT) is in a pressed state.
- LangDirection
Gets or sets the language direction for this control.
- LastClickedTimestamp
Gets time when this control was last clicked.
- LastDoubleClickTimestamp
Gets last time when mouse double click was done.
- Layout
Gets or sets layout style of the child controls.
- LayoutData
Gets or sets cached data for the layout engine.
- LayoutProps
Gets or sets additional properties which are layout specific.
- Left
Gets or sets the distance between the left edge of the control and the left edge of its container's client area.
- Location
Gets or sets the location of upper-left corner of the control, in device-independent units.
- Margin
Gets or sets the outer margin of a control.
- MaxHeight
Gets or sets the maximum height the window can be resized to.
- MaxWidth
Gets or sets the maximum width the window can be resized to.
- MaximumSize
Gets or sets the maximum size the window can be resized to.
- MeasureCanvas
Gets Graphics which can be used to measure text size and for other measure purposes.
- MinChildMargin
Gets or sets minimal value of the child's Margin property.
- MinHeight
Gets or sets the minimum height the window can be resized to.
- MinWidth
Gets or sets the minimum width the window can be resized to.
- MinimumSize
Gets or sets the minimum size the window can be resized to.
- ModifierKeys
Gets a value indicating which of the modifier keys (SHIFT, CTRL, and ALT) is in a pressed state.
- NextSibling
Gets next visible sibling control.
- Notifications
Gets collection of the attached IControlNotification objects.
- OnlyVisible
Returns this control if it is visible; otherwise returns
null
.
- Padding
Gets or sets the padding inside a control.
- Parent
Gets or sets the parent container of the control.
- ParentBackColor
Gets or sets whether BackgroundColor is automatically updated when parent's BackgroundColor is changed.
- ParentFont
Gets or sets whether Font is automatically updated when parent's Font is changed.
- ParentForeColor
Gets or sets whether ForegroundColor is automatically updated when parent's ForegroundColor is changed.
- ParentWindow
Gets the parent window of the control).
- ProcessIdle
Gets or sets whether Idle event is fired.
- RealBackgroundColor
Gets real background color for the control.
- RealFont
Gets real font value.
- RealForegroundColor
Gets real foreground color for the control.
- RecreatingHandle
Gets a value indicating whether the control is currently re-creating its handle.
- Right
Gets the distance, in dips, between the right edge of the control and the left edge of its container's client area.
- RowIndex
Gets or sets row index which is used in GetRowGroup(int, bool) and by the Grid control.
- RowSpan
Gets or sets a value that indicates the total number of rows this control's content spans within a container.
- ScaleFactor
Gets scale factor used in device-independent units to/from pixels conversions.
- Site
Gets or sets the site of the control.
- Size
Gets or sets the size of the control.
- StateFlags
Gets control flags.
- StateObjects
Gets or sets data (images, colors, borders, pens, brushes, etc.) for different control states.
- SuggestedHeight
Gets or sets the suggested height of the control.
- SuggestedSize
Gets or sets the suggested size of the control.
- SuggestedWidth
Gets or sets the suggested width of the control.
- TabStop
Gets or sets a value indicating whether the user can give the focus to this control using the TAB key.
- Tag
Gets or sets the object that contains data about the control.
- Text
Gets or sets the text associated with this control.
- Title
Gets or sets the title of the control.
- ToolTip
Gets or sets the tool-tip that is displayed for this element in the user interface.
- Top
Gets or sets the distance between the top edge of the control and the top edge of its container's client area.
- UniqueId
Gets unique id of this control.
- UserPaint
Gets or set a value indicating whether the control paints itself rather than the operating system doing so.
- VertScrollBarInfo
Gets or sets vertical scrollbar position as ScrollBarInfo.
- VerticalAlignment
Gets or sets the vertical alignment applied to this control when it is positioned within a parent control.
- Visible
Gets or sets a value indicating whether the control and all its child controls are displayed.
- VisualState
Gets current VisualControlState.
- VisualStateOverride
Gets or sets override value for the VisualState property.
- Width
Gets or sets the width of the control.
Methods
- AddGlobalNotification(IControlNotification)
Adds IControlNotification object to the global list of notifications.
- AddNotification(IControlNotification)
Adds IControlNotification object to the list of notifications.
- AlignHorizontal(RectD, Control, SizeD, HorizontalAlignment)
Calculates horizontal Control.AlignedPosition using align parameters.
- AlignVertical(RectD, Control, SizeD, VerticalAlignment)
Calculates vertical Control.AlignedPosition using align parameters.
- AvoidException(Action)
Executes Action and calls ProcessException event if exception was raised during execution.
- BeginInit()
Starts the initialization process for this control.
- BeginInvoke(Action)
Executes an action asynchronously on the thread that the control was created on.
- BeginInvoke(Delegate)
Executes a delegate asynchronously on the thread that the control was created on.
- BeginInvoke(Delegate, object?[])
Executes a delegate asynchronously on the thread that the control was created on.
- BeginUpdate()
Maintains performance while performing slow operations on a control by preventing the control from drawing until the EndUpdate() method is called.
- BindHandlerEvents()
Binds events to the handler.
- BringToFront()
Brings the control to the front of the z-order.
- BubbleErrorsChanged(DataErrorsChangedEventArgs)
Bubbles ErrorsChanged event.
- BubbleKeyAction<T>(T, Action<Control, T>)
Bubbles specified key event action with arguments.
- BubbleKeyDown(Key, uint, out bool)
Calls BubbleKeyDown(KeyEventArgs) for the focused control with the specified parameters.
- BubbleKeyUp(Key, uint, out bool)
Calls BubbleKeyUp(KeyEventArgs) for the focused control with the specified parameters.
- BubbleMouseDoubleClick(Control?, long, MouseButton, PointD?, out bool)
Bubbles mouse double-click event with the specified parameters.
- BubbleMouseDown(Control?, long, MouseButton, PointD?, out bool)
Bubbles mouse down event with the specified parameters.
- BubbleMouseMove(Control?, long, PointD?, out bool)
Bubbles mouse move event with the specified parameters.
- BubbleMouseUp(Control?, long, MouseButton, PointD?, out bool)
Bubbles mouse up event with the specified parameters.
- BubbleMouseWheel(Control?, long, int, PointD?, out bool)
Bubbles mouse wheel event with the specified parameters.
- BubbleTextInput(char, out bool)
Calls BubbleKeyPress(KeyPressEventArgs) for the focused control with the specified parameters.
- CaptureMouse()
Captures the mouse to the control.
- CenterOnParent(GenericOrientation)
Centers the window.
- ChildIgnoresLayout(Control)
Gets whether child control ignores layout.
- ChildrenOfType<T>()
Gets the subset of Children collection with child controls of specific type.
- ClientToScreen(PointD)
Converts the client-area coordinates of a specified point to screen coordinates.
- CoerceTextForHandler(string)
Called to modify text before it is assigned to the handler.
- CreateDrawingContext()
Creates the Graphics for the control.
- CreateGraphics()
Same as CreateDrawingContext(). Added mainly for legacy code.
- CreateHandler()
Creates a handler for the control.
- DebugBackgroundColor(Color?, string?)
Sets background color if UseDebugBackgroundColor is
true
and DEBUG conditional is defined.
- DefaultGetPreferredSize(Control, SizeD, LayoutStyle)
Retrieves the size of a rectangular area into which a control can be fitted, in device-independent units.
- DefaultOnLayout(Control, LayoutStyle, RectD, IReadOnlyList<Control>)
Called when the control should reposition its child controls.
- DetachHandler()
Disconnects the current control Handler from the control. This method calls Detach().
- DisposeManaged()
Override to dispose managed resources. Here we dispose all used object references.
- DoDragDrop(object, DragDropEffects)
Begins a drag-and-drop operation.
- DoInsideLayout(Action)
Executes
action
between calls to SuspendLayout() and ResumeLayout(bool).
- DoInsideUpdate(Action)
Executes
action
between calls to BeginUpdate() and EndUpdate().
- EndInit()
Ends the initialization process for this control.
- EndInvoke(IAsyncResult)
Retrieves the return value of the asynchronous operation represented by the IAsyncResult passed.
- EndUpdate()
Resumes painting the control after painting is suspended by the BeginUpdate() method.
- EnsureHandlerCreated()
Ensures that the control Handler is created, creating and attaching it if necessary.
- FindChild(ObjectUniqueId?)
Gets child with the specified id.
- Focus()
Sets input focus to the control.
- FocusNextControl(bool, bool)
Focuses the next control.
- ForEachChild(Action<Control>, bool)
Performs some action for the each child of the control.
- ForEachChild<T>(Action<T>)
Performs some action for the each child of the control.
- GetBackground(VisualControlState)
Gets the background brush for specified state of the control.
- GetBorderSettings(VisualControlState)
Gets the border settings for specified state of the control.
- GetChildOrNull(int)
Gets the child control at the specified index.
- GetChildren(bool)
Gets children as ControlSet.
- GetChildrenMaxPreferredSize(SizeD)
Gets the size of the area which can fit all the children of this control.
- GetChildrenMaxPreferredSizePadded(SizeD)
Returns a preferred size of control with an added padding.
- GetChildrenRecursive()
Gets all child controls recursively.
- GetChildren<T>(bool)
Gets children as ControlSet.
- GetColumnGroup(int, bool)
Gets ControlSet with all controls which have ColumnIndex property equal to
columnIndex
.
- GetControl(int)
Gets child control at the specified index in the collection of child controls.
- GetDPI()
Returns the DPI of the display used by this control.
- GetDefaultAttributesBgColor()
Gets background color from the default attributes.
- GetDefaultAttributesFgColor()
Gets foreground color from the default attributes.
- GetDefaultAttributesFont()
Gets font from the default attributes.
- GetDefaultFontAndColor()
Gets control's default font and colors as IReadOnlyFontAndColor.
- GetDefaultLayout()
Gets default layout in case when Layout property is null.
- GetDefaults(ControlTypeId)
Gets ControlDefaults fof the specified ControlTypeId.
- GetErrors(string?)
Gets the validation errors for this control and its child controls.
- GetFileSystem()
Gets used IFileSystem provider.
- GetFocusedControl()
Returns the currently focused control, or null if no control is focused.
- GetForeground(VisualControlState)
Gets the foreground brush for specified state of the control.
- GetGroup(int, bool)
Gets ControlSet with all controls which are members of the specified group.
- GetHandle()
Gets native handler of the control. You should not use this property.
- GetHoveredControl()
Returns the currently hovered control, or null if no control is under the mouse.
- GetMouseTargetControl(Control?)
Finds control which accepts mouse events (checks whether InputTransparent property is
true
). Returns control specified as a parameter or one of its parent controls.
- GetNativeControlSize(SizeD)
Gets size of the native control based on the specified available size.
- GetPaddedPreferredSize(SizeD)
Returns the size of the area which can fit all the children of this control, with an added padding.
- GetPreferredSize()
Calls GetPreferredSize(SizeD) with PositiveInfinity as a parameter value.
- GetPreferredSize(SizeD)
Retrieves the size of a rectangular area into which a control can be fitted, in device-independent units.
- GetRealToolTip()
Gets ToolTip value for use in the native control.
- GetRequiredHandlerType()
Gets required control handler type.
- GetRowGroup(int, bool)
Gets ControlSet with all controls which have RowIndex property equal to
rowIndex
.
- GetScrollBarInfo(bool)
Gets vertical or horizontal scrollbar position as ScrollBarInfo.
- GetScrollBarLargeChange(bool)
Gets system scrollbar large change value.
- GetScrollBarMaximum(bool)
Gets system scrollbar max range.
- GetScrollBarValue(bool)
Gets system scrollbar thumb position.
- GetScrollBarVisibility(bool)
Gets whether system scrollbar is visible.
- GetShortcuts()
Adds list of shortcuts associated with the control and its child controls. Only visible and enabled child controls are queried.
- GetSpecifiedOrChildrenPreferredSize(SizeD)
Gets the size of the control specified in its SuggestedWidth and SuggestedHeight properties or calculates preferred size from its children.
- GetStaticDefaultFontAndColor(ControlTypeId, ControlRenderSizeVariant)
Gets control's default font and colors as IReadOnlyFontAndColor.
- GetSvgColor(KnownSvgColor)
Gets known svg color depending on the value of IsDarkBackground property.
- GetUpdateClientRect()
Gets the update rectangle region bounding box in client coords. This method can be used in paint events. Returns rectangle in device-independent units.
- GetUpdateClientRectI()
Gets the update rectangle region bounding box in client coords. This method can be used in paint events. Returns rectangle in pixels.
- GetVisibleChildOrNull(int)
Gets the child control at the specified index in the list of visible child controls.
- GetVisibleChildren()
Returns enumeration with the list of visible child controls.
- Group(params Control[])
Initializes a new instance of the ControlSet class.
- Group(IReadOnlyList<Control>)
Initializes a new instance of the ControlSet class.
- HandleNeeded()
Creates native control if its not already created.
- HasIndirectParent(Control?)
Gets whether one of this control's parents equals
testParent
.
- Hide()
Conceals the control from the user.
- HideToolTip()
Hides tooltip if it is visible. This method doesn't change ToolTip property.
- Invalidate()
Invalidates the control and causes a paint message to be sent to the control.
- Invalidate(RectD)
Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control.
- Invalidate(Region?, bool)
Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control.
- Invoke(Action?)
Executes the specified action on the thread that owns the control.
- Invoke(Delegate?)
Executes the specified delegate on the thread that owns the control.
- Invoke(Delegate?, object?[])
Executes the specified delegate, on the thread that owns the control, with the specified list of arguments.
- IsTransparentBackgroundSupported()
Checks whether using transparent background might work.
- Lower()
Lowers the window to the bottom of the window hierarchy (Z-order). This function only works for top level windows.
- MemberOfGroup(int)
Checks whether this control is a member of the specified group.
- NewGroupIndex()
Generates new group index.
- OnActivated(EventArgs)
Called when the Activated event is raised.
- OnCellChanged(EventArgs)
Called when the CellChanged event is raised.
- OnChildPropertyChanged(Control, string, bool)
Called by the child control when its property is changed.
- OnChildRemoved(Control)
Called when a Control is removed from the Children collections.
- OnClick(EventArgs)
Called when the control is clicked.
- OnDeactivated(EventArgs)
Called when the Deactivated event is raised.
- OnDpiChanged(DpiChangedEventArgs)
Called when the DpiChanged event is raised.
- OnDragDrop(DragEventArgs)
Called when the DragDrop event is raised.
- OnDragEnter(DragEventArgs)
Called when the DragEnter event is raised.
- OnDragLeave(EventArgs)
Called when the DragLeave event is raised.
- OnDragOver(DragEventArgs)
Called when the DragOver event is raised.
- OnDragStart(DragStartEventArgs)
Called when the DragStart event is raised.
- OnEnabledChanged(EventArgs)
Called when the enabled of the Enabled property changes.
- OnFontChanged(EventArgs)
Called when the value of the Font property changes.
- OnGotFocus(EventArgs)
This method is invoked when the control gets focus.
- OnHandleCreated(EventArgs)
Called when the conrol's handle is created.
- OnHandleDestroyed(EventArgs)
Called when the conrol's handle is destroyed.
- OnHandlerAttached(EventArgs)
Called after a new control handler is attached.
- OnHandlerDetaching(EventArgs)
Called before the current control handler is detached.
- OnHandlerLocationChanged(EventArgs)
Called when the native conrol location is changed.
- OnHandlerSizeChanged(EventArgs)
Called when the native conrol size is changed.
- OnHandlerTextChanged()
Called when handler's text property is changed.
- OnHelpRequested(HelpEventArgs)
Called when the HelpRequested event is raised.
- OnIdle(EventArgs)
Called when when the application finishes processing events and is about to enter the idle state.
- OnIsMouseOverChanged(EventArgs)
Called when IsMouseOver property is changed.
- OnKeyDown(KeyEventArgs)
Called when the KeyDown event is raised.
- OnKeyPress(KeyPressEventArgs)
Called when the KeyPress event is raised.
- OnKeyUp(KeyEventArgs)
Called when KeyUp event is raised.
- OnLayout()
Called when the control should reposition its child controls.
- OnLocationChanged(EventArgs)
Called when the LocationChanged event is raised.
- OnLostFocus(EventArgs)
This method is invoked when the control lost focus.
- OnMarginChanged(EventArgs)
Called when the value of the Margin property changes.
- OnMouseCaptureLost(EventArgs)
Called when the control loses mouse capture.
- OnMouseDoubleClick(MouseEventArgs)
Called when the mouse button was double-clicked.
- OnMouseDown(MouseEventArgs)
Called when the mouse button was pressed.
- OnMouseEnter(EventArgs)
Called when the mouse pointer enters the control.
- OnMouseLeave(EventArgs)
Called when the mouse pointer leaves the control.
- OnMouseLeftButtonDown(MouseEventArgs)
Called when the left mouse button was pressed.
- OnMouseLeftButtonUp(MouseEventArgs)
Called when the left mouse button was released.
- OnMouseMove(MouseEventArgs)
Called when the mouse is moved.
- OnMouseRightButtonDown(MouseEventArgs)
Called when the right mouse button was pressed.
- OnMouseRightButtonUp(MouseEventArgs)
Called when the right mouse button was released.
- OnMouseUp(MouseEventArgs)
Called when the mouse button was released.
- OnMouseWheel(MouseEventArgs)
Called when the MouseWheel event is raised.
- OnPaddingChanged(EventArgs)
Called when the value of the Padding property changes.
- OnPaint(PaintEventArgs)
Called when the control is redrawn. See Paint for details.
- OnPaintBackground(PaintEventArgs)
Paints the background of the control.
- OnParentChanged(EventArgs)
Called when Parent property is changed.
- OnProcessException(ThrowExceptionEventArgs)
Called when an exception need to be processed.
- OnQueryContinueDrag(QueryContinueDragEventArgs)
Occurs during a drag-and-drop operation and enables the drag source to determine whether the drag-and-drop operation should be canceled.
- OnResize(EventArgs)
Called when the Resize event is raised.
- OnScroll(ScrollEventArgs)
Called when Scroll event is raised.
- OnSizeChanged(EventArgs)
Called when the SizeChanged event.
- OnSystemColorsChanged(EventArgs)
Called when the SystemColorsChanged event is raised.
- OnTextChanged(EventArgs)
Called when the TextChanged event is raised.
- OnTitleChanged(EventArgs)
Called when the value of the Title property changes.
- OnToolTipChanged(EventArgs)
Raises the ToolTipChanged event.
- OnTouch(TouchEventArgs)
Called when Touch event is raised.
- OnVisibleChanged(EventArgs)
Called when the value of the Visible property changes.
- OnVisualStateChanged(EventArgs)
Called when VisualStateChanged property is changed.
- PaintCaret(PaintEventArgs)
Paints internal caret for user-painted controls. This method is used on some platforms when system caret is not available.
- ParentDisposed()
Called when parent is disposed.
- PerformLayout(bool)
Forces the control to apply layout logic to child controls.
- PixelFromDip(PointD)
Converts device-independent units to pixels.
- PixelFromDip(RectD)
Converts device-independent units to pixels.
- PixelFromDip(SizeD)
Converts device-independent units to pixels.
- PixelFromDip(double)
Converts device-independent units to pixels.
- PixelToDip(PointI)
Converts PointI to device-independent units.
- PixelToDip(RectI)
Converts RectI to device-independent units.
- PixelToDip(SizeI)
Converts SizeI to device-independent units.
- PixelToDip(int)
Converts pixels to device-independent units.
- PointToClient(PointD)
Computes the location of the specified screen point into client coordinates.
- PointToScreen(PointD)
Computes the location of the specified client point into screen coordinates.
- Raise()
Raises the window to the top of the window hierarchy (Z-order). This function only works for top level windows.
- RaiseActivated()
Raises the Activated event and OnActivated(EventArgs) method.
- RaiseCellChanged()
Raises the CellChanged event and OnCellChanged(EventArgs) method.
- RaiseChildInserted(int, Control)
Raises the ChildInserted event and OnChildInserted(int, Control) method.
- RaiseChildRemoved(Control)
Raises the ChildRemoved event and OnChildRemoved(Control) method.
- RaiseClick()
Raises the Click event and calls OnClick(EventArgs). See Click event description for more details.
- RaiseDeactivated()
Raises the Deactivated event and OnDeactivated(EventArgs) method.
- RaiseDpiChanged(DpiChangedEventArgs)
Raises the DpiChanged event and OnDpiChanged(DpiChangedEventArgs) method.
- RaiseDragDrop(DragEventArgs)
Raises the DragDrop event.
- RaiseDragEnter(DragEventArgs)
Raises the DragEnter event.
- RaiseDragLeave()
Raises the DragLeave event.
- RaiseDragOver(DragEventArgs)
Raises the DragOver event.
- RaiseDragStart(DragStartEventArgs)
Raises the DragStart event.
- RaiseGotFocus()
Raises the GotFocus event and OnGotFocus(EventArgs) method.
- RaiseHandleCreated()
Raises the HandleCreated event and OnHandleCreated(EventArgs) method.
- RaiseHandleDestroyed()
Raises the HandleDestroyed event and OnHandleDestroyed(EventArgs) method.
- RaiseHandlerLocationChanged()
Raises the OnHandlerLocationChanged(EventArgs) and ReportBoundsChanged() methods.
- RaiseHandlerSizeChanged()
Raises bounds changed events and OnHandlerSizeChanged(EventArgs) method.
- RaiseHelpRequested(HelpEventArgs)
Raises the HelpRequested event and OnHelpRequested(HelpEventArgs) method.
- RaiseIdle()
Raises the Idle event and calls OnIdle(EventArgs). See Idle event description for more details.
- RaiseIsMouseOverChanged()
Raises the IsMouseOverChanged event and OnIsMouseOverChanged(EventArgs) method.
- RaiseKeyDown(KeyEventArgs)
Raises the KeyDown event and OnKeyDown(KeyEventArgs) method.
- RaiseKeyPress(KeyPressEventArgs)
Raises the KeyPress event and OnKeyPress(KeyPressEventArgs) method.
- RaiseKeyUp(KeyEventArgs)
Raises the KeyUp event and OnKeyUp(KeyEventArgs) method.
- RaiseLocationChanged()
Raises the LocationChanged event.
- RaiseLostFocus()
Raises the LostFocus event and OnLostFocus(EventArgs) method.
- RaiseMouseCaptureLost()
Raises the MouseCaptureLost event and OnMouseCaptureLost(EventArgs) method.
- RaiseMouseDoubleClick(MouseEventArgs)
Raises the MouseDoubleClick event and OnMouseDoubleClick(MouseEventArgs) method.
- RaiseMouseDown(MouseEventArgs)
Raises the MouseDown event and OnMouseDown(MouseEventArgs) method.
- RaiseMouseEnter()
Raises the MouseEnter event and OnMouseEnter(EventArgs) method.
- RaiseMouseEnterOnTarget()
Calls RaiseMouseEnter() for the control under the mouse pointer.
- RaiseMouseLeave()
Raises the MouseLeave event and OnMouseLeave(EventArgs) method.
- RaiseMouseLeaveOnTarget()
Calls RaiseMouseLeave() for the control under the mouse pointer.
- RaiseMouseLeftButtonDown(MouseEventArgs)
Raises the MouseLeftButtonDown event and OnMouseLeftButtonDown(MouseEventArgs) method.
- RaiseMouseLeftButtonUp(MouseEventArgs)
Raises the MouseLeftButtonUp event and OnMouseLeftButtonUp(MouseEventArgs) method.
- RaiseMouseMove(MouseEventArgs)
Raises the MouseMove event and OnMouseMove(MouseEventArgs) method.
- RaiseMouseRightButtonDown(MouseEventArgs)
Raises the MouseRightButtonDown event and OnMouseRightButtonDown(MouseEventArgs) method.
- RaiseMouseRightButtonUp(MouseEventArgs)
Raises the MouseRightButtonUp event and OnMouseRightButtonUp(MouseEventArgs) method.
- RaiseMouseUp(MouseEventArgs)
Raises the MouseUp event and OnMouseUp(MouseEventArgs) method.
- RaiseMouseWheel(MouseEventArgs)
Raises the MouseWheel event and OnMouseWheel(MouseEventArgs) method.
- RaisePaint(PaintEventArgs)
Raises the Paint event and OnPaint(PaintEventArgs) method.
- RaiseParentChanged()
Raises the ParentChangedevent and OnParentChanged(EventArgs) .
- RaiseQueryContinueDrag(QueryContinueDragEventArgs)
Raises the QueryContinueDrag event and OnQueryContinueDrag(QueryContinueDragEventArgs) method.
- RaiseScroll(ScrollEventArgs)
Raises the Scroll event and OnScroll(ScrollEventArgs) method.
- RaiseSizeChanged()
Raises the SizeChanged, Resize events and OnSizeChanged(EventArgs), OnResize(EventArgs) methods.
- RaiseSystemColorsChanged()
Raises the SystemColorsChanged event and OnSystemColorsChanged(EventArgs) method.
- RaiseTextChanged()
Raises the TextChanged event.
- RaiseTitleChanged()
Raises the TitleChanged event and calls OnTitleChanged(EventArgs).
- RaiseTouch(TouchEventArgs)
Raises the Touch event and calls OnTouch(TouchEventArgs) method.
- RaiseVisualStateChanged()
Raises the VisualStateChanged event and OnVisualStateChanged(EventArgs) method.
- RecreateWindow()
Forces the re-creation of the underlying native control.
- Refresh()
Forces the control to invalidate itself and immediately redraw itself and any child controls. Calls Invalidate() and Update().
- RefreshRect(RectD, bool)
Same as Invalidate(RectD) but has additional parameter
eraseBackground
.
- RefreshRects(IEnumerable<RectI>, bool)
Repaints rectangles (coordinates in pixels) in the control.
- RefreshRectsUnion(IEnumerable<RectI>, bool)
Calculates bounds of the specified rectangles collection and repaints combined rectangle. Coordinates are in pixels.
- ReleaseMouseCapture()
Releases the mouse capture, if the control held the capture.
- RemoveGlobalNotification(IControlNotification)
Removes IControlNotification object from the global list of notifications.
- RemoveNotification(IControlNotification)
Removes IControlNotification object from the list of notifications.
- ReportBoundsChanged()
Calls LocationChanged and SizeChanged events if Bounds property was changed.
- ResetBackgroundColor()
Resets bacgkround color to the default value.
- ResetBackgroundColor(ResetColorType)
Resets bacgkround color to the default value.
- ResetForeColor()
Resets foreground color to the default value.
- ResetForegroundColor()
Resets foreground color to the default value.
- ResetForegroundColor(ResetColorType)
Resets foreground color to the default value.
- ResetScaleFactor()
Resets cached value of the ScaleFactor property, so it will be retrieved from the handler next time it is used.
- ResetSuggestedHeight()
Resets SuggestedHeight property.
- ResetSuggestedSize()
Resets SuggestedSize property.
- ResetSuggestedWidth()
Resets SuggestedWidth property.
- ResumeLayout(bool)
Resumes the usual layout logic.
- SaveScreenshot(string)
Saves screenshot of this control.
- ScreenToClient(PointD)
Converts the screen coordinates of a specified point on the screen to client-area coordinates.
- SendToBack()
Sends the control to the back of the z-order.
- SetBackground(Brush?, VisualControlState)
Sets background brush for the specified control state.
- SetBorder(BorderSettings?, VisualControlState)
Sets border settings for the specified control state.
- SetBounds(RectD, BoundsSpecified)
Sets the specified bounds of the control to new location and size.
- SetBounds(double, double, double, double, BoundsSpecified)
Sets the specified bounds of the control to new location and size.
- SetChildIndex(Control, int)
Sets the index of the child control in the Children.
- SetChildrenBackgroundColor(Color?, bool)
Sets children background color.
- SetChildrenBackgroundColor<T>(Color?, bool)
Sets children background color.
- SetChildrenFont(Font?, bool)
Sets children font.
- SetChildrenForegroundColor(Color?, bool)
Sets children foreground color.
- SetChildrenForegroundColor<T>(Color?, bool)
Sets children foreground color.
- SetCursor(Cursor?)
Changes Cursor property.
- SetEnabled(bool)
Same as Enabled but implemented as method.
- SetFocus()
Sets input focus to the control.
- SetFocusIfPossible()
Sets input focus to the control if it can accept it.
- SetImage(Image?, VisualControlState)
Sets image for the specified control state.
- SetMouseCapture(bool)
Sets or releases mouse capture.
- SetRowColumn(int, int)
Sets a value that indicates which row and column control should appear in.
- SetScrollBar(bool, HiddenOrVisible, int, int, int)
Sets system scrollbar properties.
- SetScrollBarInfo(bool, ScrollBarInfo)
Sets vertical or horizontal scrollbar position as ScrollBarInfo.
- SetSizeToContent(WindowSizeToContentMode)
Changes size of the control to fit the size of its content.
- SetStyle(ControlStyles, bool)
Sets a specified ControlStyles flag to either true or false.
- SetText(string?)
Sets value of the Text property.
- SetTitle(string?)
Sets Title property.
- SetVisibleValue(bool)
Sets visible field value. This is internal method and should not be called directly.
- Show()
Displays the control to the user.
- ShowPopupMenu(ContextMenu?, double, double)
Pops up the given menu at the specified coordinates, relative to this window, and returns control when the user has dismissed the menu.
- SuspendLayout()
Temporarily suspends the layout logic for the control.
- TouchToMouseEvents(TouchEventArgs)
Calls appropriate mouse events using specified TouchEventArgs.
- UnbindHandlerEvents()
Unbinds events from the handler.
- Update()
Causes the control to redraw the invalidated regions.
- UpdateToolTip()
Updates ToolTip so it will be repainted in the screen if it is currently shown.
Events
- Activated
Occurs when the window is activated in code or by the user.
- AfterHide
Occurs after control was hidden.
- AfterShow
Occurs after control was shown.
- BackgroundChanged
Occurs when the value of the Background property changes.
- CellChanged
Occurs when cell settings are changed.
- ChildInserted
Occurs when the child control is added to this control.
- ChildRemoved
Occurs when the child control is removed from this control.
- ChildVisibleChanged
Occurs when the child control's Visible property is changed.
- Click
Occurs when the control is clicked.
- CustomLayout
Occurs when the control needs to layout its children.
- Deactivated
Occurs when the window loses focus and is no longer the active window.
- DpiChanged
Occurs when the DPI setting changes on the display device where the form is currently displayed.
- DragDrop
Occurs when a drag-and-drop operation is completed.
- DragEnter
Occurs when an object is dragged into the control's bounds.
- DragLeave
Occurs when an object is dragged out of the control's bounds.
- DragOver
Occurs when an object is dragged over the control's bounds.
- DragStart
Occurs when a drag-and-drop operation needs to be started.
- EnabledChanged
Occurs when the value of the Enabled property changes.
- ErrorsChanged
Occurs when the validation errors have changed for this control or its child controls.
- FocusedControlChanged
Occurs when focused control is changed.
- FontChanged
Occurs when the value of the Font property changes.
- ForegroundChanged
Occurs when the value of the Foreground property changes.
- GlobalGetPreferredSize
Occurs inside GetPreferredSize(SizeD) method.
- GlobalOnLayout
Occurs when the the control should reposition its child controls.
- GotFocus
Occurs when the contol gets focus.
- HandleCreated
Occurs when the control's handle is created.
- HandleDestroyed
Occurs when the control's handle is destroyed.
- HelpRequested
When implemented by a class, occurs when user requests help for a control
- HorizontalAlignmentChanged
Occurs when the value of the HorizontalAlignment property changes.
- HoveredControlChanged
Occurs when hovered control is changed. Control is hovered when mouse pointer is over it.
- Idle
Occurs when the application finishes processing events and is about to enter the idle state. This is the same as Idle but on the control level.
- IsMouseOverChanged
Occurs when the IsMouseOver property value changes.
- KeyDown
Occurs when a key is pressed while the control has focus.
- KeyPress
Occurs when a character, space or backspace key is pressed while the control has focus.
- KeyUp
Occurs when a key is released while the control has focus.
- LocationChanged
Occurs when the control's location is changed.
- LostFocus
Occurs when the control lost focus.
- MarginChanged
Occurs when the value of the Margin property changes.
- MouseCaptureLost
Occurs when the control loses mouse capture.
- MouseDoubleClick
Occurs when the control is double clicked by the mouse.
- MouseDown
Occurs when the mouse pointer is over the control and a mouse button is pressed.
- MouseEnter
Occurs when the mouse pointer enters the control.
- MouseLeave
Occurs when the mouse pointer leaves the control.
- MouseLeftButtonDown
Occurs when the mouse pointer is over the control and left mouse button is pressed.
- MouseLeftButtonUp
Occurs when the mouse pointer is over the control and left mouse button is released.
- MouseMove
Occurs when the mouse pointer is moved over the control.
- MouseRightButtonDown
Occurs when the mouse pointer is over the control and right mouse button is pressed.
- MouseRightButtonUp
Occurs when the mouse pointer is over the control and right mouse button is released.
- MouseUp
Occurs when the mouse pointer is over the control and a mouse button is released.
- MouseWheel
Occurs when the mouse wheel moves while the control has focus.
- PaddingChanged
Occurs when the value of the Padding property changes.
- Paint
Occurs when the control is redrawn.
- ParentChanged
Occurs when Parent is changed.
- ProcessException
Occurs when exception is raised inside AvoidException(Action).
- QueryContinueDrag
Occurs during a drag-and-drop operation and enables the drag source to determine whether the drag-and-drop operation should be canceled.
- Resize
Occurs when the control's size is changed.
- Scroll
Occurs when the user scrolls through the control contents using scrollbars.
- SizeChanged
Occurs when the control's size is changed.
- SystemColorsChanged
Occurs when the system colors change.
- TextChanged
Occurs when the Text property value changes.
- TitleChanged
Occurs when the value of the Title property changes.
- ToolTipChanged
Occurs when the ToolTip property value changes.
- Touch
Occurs when screen is touched by the user's finger.
- VerticalAlignmentChanged
Occurs when the value of the VerticalAlignment property changes.
- VisibleChanged
Occurs when the value of the Visible property changes.
- VisualStateChanged
Occurs when the VisualState property value changes.