Links

Bunifu Separator

Divide panel layout content into clear groups.

Overview

Bunifu Separator is a rich and modest .NET line control that allows us to partition user interface layouts, resulting in a modular interface design.

Getting Started

This section describes adding Bunifu Separator at the designer level and during a runtime event.

Adding Bunifu Separator at Design Time

Bunifu Separator can be added to a form at the designer level by locating or searching BunifuSeparator in your toolbox and drag it to your form as shown below.

Adding Bunifu Separator at Runtime

To add Bunifu Separator at run time we will use the Load event handler of the form and render the separator. Generally, these situations are uncommon, but to include the control at run time, write the following code:
C#
VB.NET
private void Form1_Load(object sender, EventArgs e)
{
//instantiate the separator control using Bunifu.UI.WinForms
BunifuSeparator bunifuSeparator = new BunifuSeparator();
//set the location of the control
bunifuSeparator.Location = new Point(195, 150);
//set the color for the control
bunifuSeparator.LineColor = Color.DodgerBlue;
//set the line style for the separator
bunifuSeparator.LineStyle = BunifuSeparator.LineStyles.DashDot;
//add the control to the form
this.Controls.Add(bunifuSeparator);
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
'instantiate the separator control using Bunifu.UI.WinForms
Dim bunifuSeparator As New BunifuSeparator()
'set the location of the control
bunifuSeparator.Location = New Point(195, 150)
'set the color for the control
bunifuSeparator.LineColor = Color.DodgerBlue
'set the line style for the separator
bunifuSeparator.LineStyle = BunifuSeparator.LineStyles.DashDot
'add the control to the form
Me.Controls.Add(bunifuSeparator)
End Sub
Let's take a deep dive and get insights into the available properties on Bunifu Separator.

Key Properties

1. LineColor

This property allows you to get or set the line's fill color. It is compatible with the use of RGB and HEX color values.

2. LineThickness

This property allows you to get or set the line's height/thickness. It only accepts integer values and has a default value of its thickness is 1. The value provided determines the thickness of the line thus, the greater the value provided, the thicker the line.

3. Orientation

This property allows you to get or set the position enumeration for the line control. The position enumeration defines the following values:(i.e., the Vertical and Horizontal positions). The default orientation value set is Horizontal.

4. LineStyle

This property allows you to get or set an appearance enumeration of the line control. The default value of the property is the Solid enumeration. The line style enumerations define the following:
Enumeration
Description
Solid
Renders the separator control as a straight line.
Dash
Renders the separator control with a dashed line output.
Dot
Renders the separator control with a series of dotted pixel output.
DashDot
Renders a combined series of dash and dot pixel output for the separator control.
DashDotDot
Combines a dash line and two dotted pixels to create a separator control.
DoubleEdgeFaded
Creates a straight line with a faded color on both ends.
LeftEdgeFaded
Creates a straight line with a faded color on the left end.
RightEdgeFaded
Creates a straight line with a faded color on the right end.

5. DashCap

This property allows you to get or set a dash edge cap style of the line control.
This property is only applicable when the LineStyle property is set to one of the available Dash enumerations.
The DashCap's default value is the Flat value. Other value enumerations include: Round and Triangle.

Take Away

We hope that you have gained insights into using Bunifu Separator as a layout component for form. Should you have feedback or suggestions please send us via chat on the bottom right corner of the screen.