Table of Contents

Class GenericBorder

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

Represents a graphical control with customizable borders, supporting individual border widths, colors, and corner radii for each side.

public class GenericBorder : GenericControl, IBaseObjectWithAttr, IBaseObjectWithId, INotifyPropertyChanged, IDisposableObject, IBaseObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, IControl, IDisposable, IWin32Window, ILayoutItem, INotifyDataErrorInfo
Inheritance
GenericBorder
Implements
Derived

Remarks

Use this control to display content with visually distinct borders. Border properties such as width, color, and margin can be set individually or uniformly for all sides. The control provides methods to configure which borders are visible and to reset border settings to their defaults. Padding can be automatically adjusted to accommodate border changes. Inherits from GenericControl and extends its appearance customization capabilities.

Constructors

GenericBorder()

Initializes a new instance of the GenericBorder class.

GenericBorder(AbstractControl)

Initializes a new instance of the GenericBorder class.

Fields

ShowDebugCorners

Gets or sets whether to show debug corners when control is painted.

Properties

AutoPadding

Gets or sets whether Padding is updated when border width or visibility is changed. Default value is True.

Background

Gets or sets the background brush for the control. Usage of this property depends on the control. Not all controls support it.

BackgroundColor

Gets or sets the background color for the control.

BorderColor

Gets or sets the border color for the GenericBorder control.

BorderMargin

Gets or sets the margin around the border.

BorderWidth

Gets or sets the border width for the GenericBorder control.

ControlKind

Returns control identifier.

DefaultBorderWidth

Gets or sets the default border width for the GenericBorder control.

HasBorder

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

HasVisibleBorderBottom

Gets whether bottom border is visible.

HasVisibleBorderTop

Gets whether top border is visible.

NormalBorder

Gets or sets individual border side settings in the normal visual state.

UniformBorderCornerRadius

Gets or sets the uniform corner radius for the Border control.

UniformBorderRadiusIsPercent

Gets or sets whether the uniform corner radius for the Border control is specified in percent.

UniformBorderWidth

Gets or sets the uniform border width for the GenericBorder control.

Methods

CreateBorderSettings(BorderSettings)

Creates used BorderSettings instance. Override to have border painting or non-default behavior.

CreateDefaultBorder(Color?)

Creates border filled with default settings.

DefaultPaint(PaintEventArgs)

Default painting method of the GenericControl and its descendants.

DefaultPaintDebug(PaintEventArgs)
DrawBorderAndBackground(PaintEventArgs, DrawDefaultBackgroundFlags)

Draws the border and background for the control using the specified paint event arguments.

GetDefaultParentBackColor()

Gets default value for ParentBackColor property.

GetDefaultParentForeColor()

Gets default value for ParentForeColor property.

GetPreferredSize(PreferredSizeContext)

Retrieves the size of a rectangular area into which a control can be fitted, in device-independent units.

OnSizeChanged(EventArgs)

Called when the SizeChanged event.

OnlyBottomBorder(float?)

Configures border so only bottom border is visible and other borders are hidden.

OnlyTopBorder(float?)

Configures border so only top border is visible and other borders are hidden.

ResetBorders()

Resets border so it is returned to the initial state as it was specified in the constructor.

SafeBorderWidth(AbstractControl?)

Gets Thickness that represents border widths for the specified control.

SetBorderColors(Color?)

Sets the color for all four borders (left, right, top, bottom) simultaneously.

SetBorderColors(Color?, Color?, Color?, Color?)

Sets colors of the individual border edges.

SetBottomBorderColor(Color?)

Sets the color of the bottom border.

SetLeftBorderColor(Color?)

Sets the color of the left border.

SetRightBorderColor(Color?)

Sets the color of the right border.

SetTopBorderColor(Color?)

Sets the color of the top border.

SetVisibleBorders(bool, bool, bool, bool, float?)

Sets visible borders. Changes border side widths depending on the parameter values.

UpdatePadding()

Updates Padding with border size.