Table of Contents

Class UserControl

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

Parent class for all owner draw controls.

[ControlCategory("Other")]
public class UserControl : Control, IBaseObjectWithAttr, IBaseObjectWithId, INotifyPropertyChanged, IDisposableObject, IBaseObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, IControl, IDisposable, IWin32Window, ILayoutItem, INotifyDataErrorInfo
Inheritance
UserControl
Implements
Derived

Constructors

UserControl()

Initializes a new instance of the UserControl class.

UserControl(AbstractControl)

Initializes a new instance of the UserControl class.

Properties

ControlKind

Returns control identifier.

HasBorder

Gets or sets a value indicating whether the control has a border.

Overlays

Gets or sets the collection of overlays associated with the control.

RefreshOptions

Gets or sets different behavior and visualization options.

ScrollBars

Gets or sets the type of scroll bars displayed in the control.

WantChars

Gets or sets whether control wants to get all char/key events for all keys.

Methods

AddOverlay(IControlOverlay, bool)

Adds the specified overlay to the control.

DefaultPaint(PaintEventArgs)

Default painting method of the UserControl and its descendants.

DefaultPaintDebug(PaintEventArgs)

Provides default debug related painting behavior for the control when the application is compiled in debug mode.

GetBackground(VisualControlState)

Gets the background brush for specified state of the control.

GetBackgroundAction(VisualControlState)

Gets the background paint action for specified state of the control.

GetBorderSettings(VisualControlState)

Gets the border settings for specified state of the control.

GetDefaultHasBorder()

Gets default value for HasBorder.

GetOverlayRectangle()

Gets rectangle to which the overlay should be fitted.

GetOverlays()

Gets overlays attached to this control.

GetRequiredHandlerType()

Gets required control handler type.

HasOverlays()

Gets whether this control has overlays.

OnAfterPaint(PaintEventArgs)

Invoked after the control has completed its painting operations.

OnAfterPaintChildren(PaintEventArgs)

Called after the control's child elements have been painted. Allows for additional custom painting after the default child painting logic completes.

OnKeyDown(KeyEventArgs)

Called when the KeyDown event is raised.

OnMouseLeftButtonDown(MouseEventArgs)

Called when the left mouse button was pressed.

OnMouseLeftButtonUp(MouseEventArgs)

Called when the left mouse button was released.

OnPaint(PaintEventArgs)

Called when the control is redrawn. See Paint for details.

OnSystemColorsChanged(EventArgs)

Called when the SystemColorsChanged event is raised.

OnVisualStateChanged(EventArgs)

Called when VisualStateChanged property is changed.

PaintOverlays(PaintEventArgs)

Paints all overlays associated with the control.

RaiseAfterPaint(PaintEventArgs)

Raises the AfterPaint event and invokes the OnAfterPaint method.

RemoveOverlay(IControlOverlay, bool)

Removes the specified overlay from the control.

RemoveOverlay(ObjectUniqueId?, bool)

Removes an overlay with the specified unique identifier from the overlays collection.

RemoveOverlay(ref ObjectUniqueId?, bool)

Removes the overlay with the specified identifier from the collection. After removal, sets the identifier to null.

RemoveOverlays(ControlOverlayFlags, bool)

Removes overlays from the control that match the specified flags.

SetStateColors(VisualControlState, IReadOnlyFontAndColor?)

Sets StateObjects colors and backgrounds for the state specified in the state parameter to the colors from fontAndColor.

ShowOverlayToolTip(OverlayToolTipParams)

Displays an overlay tooltip at the specified location with the provided content and removal interval.

ShowOverlayToolTip(object?, object?, MessageBoxIcon?, HVAlignment?, OverlayToolTipFlags, int?)

Displays an overlay tooltip with the specified title, message, and options.

ShowOverlayToolTipSimple(object?, HVAlignment, OverlayToolTipFlags)

Displays a simple overlay tooltip with the specified message, alignment, and options.

ShowOverlayToolTipSimple(object?, PointD?, HVAlignment?, OverlayToolTipFlags, int?)

Displays a simple overlay tooltip with the specified message and optional customization parameters.

ShowOverlayToolTipWithError(object?, object, HVAlignment?, OverlayToolTipFlags, int?)

Displays an overlay tooltip with an error message based on the provided exception.

Events

AfterPaint

Occurs after the control has finished its painting operation.