Bunifu Radio Button
Create stylishly themed and customizable Radio buttons with in-built look and feel features and more.

Overview

Bunifu Radio Button is a feature-rich .NET control whose primary purpose is the selection of one option from a list of pre-defined choices. It features different states and appearance customizations.

Getting Started

Adding Bunifu Radio Button At Design Time

Bunifu Radio Button is simply added to a form at the designer level by locating/searching BunifuRadioButton in your toolbox and dragging it to your form as shown below:
Next, you need to bind a label which will be your click target. To set it up:
Step one: Drag a Bunifu Label besides Bunifu Radio Button and give it a meaningful name.
Step two: Access Bunifu Radio's smart tag and set the BindingControl property to the value with the name of the Bunifu Label control:
Ensure that the AllowBindingControlLocation is checked.

Adding Bunifu Radio Button At Runtime

To add Bunifu Radio Button at run time, use the Load event of your Form to write the following code:
C#
VB.NET
1
private void Form1_Load(object sender, EventArgs e)
2
{
3
//instatiate Bunifu Radio Button using Bunifu.UI.WinForms;
4
BunifuRadioButton bunifuRadio = new BunifuRadioButton();
5
//set the location for the radio button
6
bunifuRadio.Location = new Point(290, 150);
7
//instatiate a Bunifu Label to bind to the radio button
8
BunifuLabel bunifuLabel = new BunifuLabel();
9
//set the text for the label
10
bunifuLabel.Text = "Option one";
11
//bind the label to Bunifu Radio
12
bunifuRadio.BindingControl = bunifuLabel;
13
bunifuRadio.AllowBindingControlLocation = true;
14
//add the two controls to the form
15
this.Controls.AddRange(new Control[] { bunifuRadio, bunifuLabel }) ;
16
}
Copied!
1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
2
'instatiate Bunifu Radio Button using Bunifu.UI.WinForms;
3
Dim bunifuRadio As New BunifuRadioButton()
4
'set the location for the radio button
5
bunifuRadio.Location = New Point(290, 150)
6
'instatiate a Bunifu Label to bind to the radio button
7
Dim bunifuLabel As New BunifuLabel()
8
'set the text for the label
9
bunifuLabel.Text = "Option one"
10
'bind the label to Bunifu Radio
11
bunifuRadio.BindingControl = bunifuLabel
12
bunifuRadio.AllowBindingControlLocation = True
13
'add the two controls to the form
14
Me.Controls.AddRange(New Control() { bunifuRadio, bunifuLabel })
15
End Sub
16
Copied!
Let's take a deep dive and get insights into the available properties on Bunifu Radio Button.

Appearance Properties

1. BorderThickness

This property allows you to get or set the height/ border height of the control. Only integer values are accepted in this property.

2. OutlineColor

This property allows you to get or set the border color of the radio button. It accepts RGB and HEX color values as inputs.

3. OutlineColorTabFocus

This property enables you to get or set the radio button's hover border color; the color is activated once the control is hovered over.

4. OutlineColorUnchecked

This property allows you to get or set the radio button's unchecked state border color.

5. RadioColor

This property allows you to get or set a color value fill for the inner circle; the color gets activated when the control is in the checked state.

6. RadioColorTabFocused

This property allows you to get or set a hover color value for the inner circle; the color gets activated once the control is hovered over.

Behavioral Properties

1. Checked

This property allows you to get or set the initial state of a Bunifu Radio Button. The property accepts a boolean value that, when true, toggles the radio button's state to a selected state.
Bunifu Radio buttons should always be placed under a group box or a panel defining a category for selection.
The checkedChanged event fires whenever the radio button state changes. Here's is a code implementing the event:
C#
VB.NET
1
private void dailyBunifuRadioButton_CheckedChanged(object sender, Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs e)
2
{
3
if (e.Checked)
4
{
5
MessageBox.Show("Daily updates set");
6
}
7
8
}
9
10
private void weeklyBunifuRadioButton_CheckedChanged(object sender, Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs e)
11
{
12
if (e.Checked)
13
{
14
MessageBox.Show("Weekly updates set");
15
}
16
}
17
18
private void montlyBunifuRadioButton_CheckedChanged(object sender, Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs e)
19
{
20
if (e.Checked)
21
{
22
MessageBox.Show("Monthly updates set");
23
}
24
}
Copied!
1
Private Sub dailyBunifuRadioButton_CheckedChanged(ByVal sender As Object, ByVal e As Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs)
2
If e.Checked Then
3
MessageBox.Show("Daily updates set")
4
End If
5
6
End Sub
7
8
Private Sub weeklyBunifuRadioButton_CheckedChanged(ByVal sender As Object, ByVal e As Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs)
9
If e.Checked Then
10
MessageBox.Show("Weekly updates set")
11
End If
12
End Sub
13
14
Private Sub montlyBunifuRadioButton_CheckedChanged(ByVal sender As Object, ByVal e As Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs)
15
If e.Checked Then
16
MessageBox.Show("Monthly updates set")
17
End If
18
End Sub
19
Copied!

2. BindingControl

This property allows you to get or set a binding control (i.e., the control's click target e.g the Label, PictureBox, etc..).Typically, the label serves as the binding control or the click target. Only a few cases necessitate the use of additional .NET controls. The bound control receives the Radio Button control's click events, which set the control's state(checked or unchecked state).
In no case should the parent control of a Bunifu Radio Button be bound.

3. BindingControlPosition

This property allows you to get or set a position enumeration for the bound control. The position enumeration define the following values: (i.e., the Left and Right positions).
This property ensures adequate spacing between buttons and labels, making it crystal clear which choice corresponds to which label. This helps you to avoid situations where it is extremely difficult to see the correct radio button to click.

Take Away

Bunifu Radio button is a rich essential element of forms and when utilizing radio buttons, it is critical to ensure that this .NET UI element is predictable for users, as this improves users' ability to control the system.
We hope you have gained insights using Bunifu Radio Button and that it will help you create a better user experience for your users. Should you have feedback or suggestions please send us via chat on the bottom right corner of the screen.
Last modified 2mo ago