Class Border
Draws a border, background, or both around another control.
[ControlCategory("Containers")]
public class Border : UserControl, IBaseObject, IDisposableObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, IControl, IDisposable, IWin32Window, INotifyDataErrorInfo
- Inheritance
-
Border
- Implements
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
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.
- ControlKind
Returns control identifier.
- 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 UserControl and its descendants.
- GetPreferredSize(SizeD)
Retrieves the size of a rectangular area into which a control can be fitted, in device-independent units.
- SetColors(Color, Color, Color, Color)
Sets colors of the individual border edges.