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 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 run time

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
1
private void Form1_Load(object sender, EventArgs e)
2
{
3
//instantiate the separator control using Bunifu.UI.WinForms
4
BunifuSeparator bunifuSeparator = new BunifuSeparator();
5
//set the location of the control
6
bunifuSeparator.Location = new Point(195, 150);
7
//set the color for the control
8
bunifuSeparator.LineColor = Color.DodgerBlue;
9
//set the line style for the separator
10
bunifuSeparator.LineStyle = BunifuSeparator.LineStyles.DashDot;
11
//add the control to the form
12
this.Controls.Add(bunifuSeparator);
13
}
Copied!
1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
2
'instantiate the separator control using Bunifu.UI.WinForms
3
Dim bunifuSeparator As New BunifuSeparator()
4
'set the location of the control
5
bunifuSeparator.Location = New Point(195, 150)
6
'set the color for the control
7
bunifuSeparator.LineColor = Color.DodgerBlue
8
'set the line style for the separator
9
bunifuSeparator.LineStyle = BunifuSeparator.LineStyles.DashDot
10
'add the control to the form
11
Me.Controls.Add(bunifuSeparator)
12
End Sub
13
Copied!
Let's take a deep dive and get insights into the available properties on Bunifu Separator.

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.
Last modified 1mo ago