Table of Contents

Class Border

Namespace
Alternet.UI
Assembly
Alternet.UI.dll

Draws a border, background, or both around another control.

[ControlCategory("Containers")]
public class Border : UserPaintControl, IBaseObject, IDisposableObject, IInputElement, ISupportInitialize, IFocusable, IWin32Window, ITextProperty, IComponent, IDisposable
Inheritance
Border
Implements
Extension Methods

Examples

Here is how to declare a Border in UIXML:

<Border Name="border" Margin="16">
  <StackPanel Orientation="Vertical" Margin="5,0,0,0">
    <Label Text="Label inside border" Margin="8" />
    <Button Text="Button inside border" HorizontalAlignment="Left" Margin="8" />
  </StackPanel>
</Border>

Also, a Border can be created from code:

var Border = new Alternet.UI.Border();
Border.BorderColor = Alternet.Drawing.Color.DarkGray;
Border.Background = Alternet.Drawing.Brushes.Khaki;

Remarks

If you want to display a border around your content, you must place the controls within a parent Border element.

Examples of how a Border can look on different platforms:

Constructors

Border()

Initializes a new instance of the Border class.

Properties

Background

Gets or sets the background brush for the control.

BorderColor

Gets or sets the border color for the Border control.

BorderWidth

Gets or sets the border width for the Border 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 (1/96th inch per unit).

ControlKind

Returns control identifier.

DefaultBorderColor

Gets or sets the default border color for the Border control.

DefaultBorderWidth

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

Normal

Gets or sets individual border side settings.

UniformBorderWidth

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

UniformCornerRadius

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

UniformRadiusIsPercent

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

Methods

CreateBorderSettings(BorderSettings)

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

CreateDefault(Color?)

Creates border filled with default settings.

DefaultPaint(Graphics, RectD)

Default painting method of the UserPaintControl and its descendants.

GetPreferredSize(SizeD)

Retrieves the size of a rectangular area into which a control can be fitted, in device-independent units (1/96th inch per unit).

OnCurrentStateChanged(EventArgs)

Called when CurrentStateChanged property is changed.

SetColors(Color, Color, Color, Color)

Sets colors of the individual border edges.