Bunifu CheckBox
Tristate support: Checked, unchecked, and indeterminate states; Flexible UI customization for checked and unchecked states.
Last updated
Tristate support: Checked, unchecked, and indeterminate states; Flexible UI customization for checked and unchecked states.
Last updated
Bunifu Checkbox is a .NET control used for selecting one or more options from a list of predefined choices. With Bunifu CheckBox you can design way good-looking checkboxes that will guarantee a great user experience. It supports an indeterminate state, different sizes, custom labels and positions, and UI customization
Bunifu CheckBox works like the standard CheckBox and is used by the user for selecting options. Below is an illustration whereby Bunifu Checkbox has been used in creating a predefined user choice list of settings.
It's easy to add Bunifu Checkbox control at design time. Start by locating Bunifu Checkbox from your toolbox and simply drag it to your form as shown below then customize it to your desired look and feel using properties that will be elaborated on later in this article.
Let's continue with an example and begin by creating a simple application that tracks a list of to-do items in a day.
Step one: Create a new form and set its layout as shown below:
Step two: Set the FlowLayoutPanel
to a flow direction of Top-down. Then drop a Panel inside the FlowLayoutPanel
and resize it to a width of 174 and a height of 48. Also, set its background color to 235, 245, 255
Step three: Inside the panel, drop a Bunifu Checkbox control and Bunifu Label, then position them as illustrated below:
Step four: Access the properties of the checkbox and look out for the BindingControl
property and set the label beside it as the binding control. Then replicate the panel within the FlowLayoutPanel. And as you duplicate the panels ensure you change the label text.
Step five: Write the following code in the form load event. Here we'll loop through the controls in the FlowLayoutPanel
, get the checkboxes and assign a CheckStateChanged
event to each of them through code:
Step 6: In the CheckStateChanged event handler method write the following code. We'll retrieve the selected Bunifu Checkbox and add a condition to determine if it is checked or unchecked.
The following output will be displayed as a result of the preceding code:
You can add a Bunifu Checkbox control during runtime. Simply navigate to your Form's Load event and add the following code snippet:
Let's take a deep dive and get insights into the properties that are available on Bunifu Checkbox.
OnCheck
state propertiesWith Bunifu CheckBox you can apply a number of properties to your checkbox when the checkbox state is checked.
1. BorderColor
This property allows you to get or set the checkbox border color. It supports the use of HEX, RGB, and ARGB color formats.
2. BorderRadius
This property allows you to get the radius's integer value or set an integer value that makes a curve on the checkbox edges. By increasing the integer value, the checkbox edges become more curved.
3. BorderThickness
This property allows you to get the thickness's integer value or set an integer value that sets width to the checkbox borders. The checkbox borders get increasingly thicker as you set a larger integer value.
4. CheckBoxColor
This property allows you to get the inner color value or set the checkbox's inner fill color. It supports the use of HEX, RGB, and ARGB color formats.
5. CheckmarkColor
This property allows you to get the color value of the tick or define the checkbox's tick icon. It supports the use of HEX, RGB, and ARGB color formats.
6. CheckmarkThickness
This property allows you to get the thickness integer value of the checkbox tick set an integer value that determines the thickness of the tick icon in the checkbox control.
7. UseBorderThicknessForCheckmark
This property allows you to get the property's boolean value or set a bool value(i.e. true or false), which when set to true, will apply the value specified in the BorderThickness
property to be applied to both the checkbox border its tick icon concurrently.
OnUncheck
state propertyYou can customize Bunifu CheckBox when its state is unchecked:
Here is a discussion of the applicable properties:
1. BorderColor
This property allows you to get or set the checkbox border color. It supports the use of HEX, RGB, and ARGB color formats.
2. BorderRadius
This property allows you to get the radius's integer value or set an integer value that makes a curve on the checkbox edges. By increasing the integer value, the checkbox edges become more curved.
3. BorderThickness
This property allows you to get the thickness's integer value or set an integer value that sets width to the checkbox borders. The checkbox borders get increasingly thicker as you set a larger integer value.
4. CheckBoxColor
This property allows you to get the inner color value or set the checkbox's inner fill color. It supports the use of HEX, RGB, and ARGB color formats.
OnDisable
state propertyThe disabled state properties of Bunifu Checkbox can be easily accessed on the OnDisable category in the properties pane.
Below is a description of the properties in an OnDisable state:
1. BorderColor
This property allows you to get or set the checkbox border color. It supports the use of HEX, RGB, and ARGB color formats.
2. BorderRadius
This property allows you to get the radius's integer value or set an integer value that makes a curve on the checkbox edges. By increasing the integer value, the checkbox edges become more curved.
3. BorderThickness
This property allows you to get the thickness's integer value or set an integer value that sets width to the checkbox borders. The checkbox borders get increasingly thicker as you set a larger integer value.
4. CheckBoxColor
This property allows you to get the inner color value or set the checkbox's inner fill color. It supports the use of HEX, RGB, and ARGB color formats.
5. CheckmarkColor
This property allows you to get the color value of the tick or define the checkbox's tick icon. It supports the use of HEX, RGB, and ARGB color formats.
6. CheckmarkThickness
This property allows you to get the thickness integer value of the checkbox tick set an integer value that determines the thickness of the tick icon in the checkbox control.
7. UseBorderThicknessForCheckmark
This property allows you to get the property's boolean value or set a bool value(i.e. true or false), which when set to true, will apply the value specified in the BorderThickness
property to be applied to both the checkbox border its tick icon concurrently.
OnHoverUnchecked
state property Similarly, you can customize further the appearance of Bunifu CheckBox when it is hovered and the checkbox state is unchecked. Below are available properties:
1. BorderColor
This property allows you to get or set the checkbox border color. It supports the use of HEX, RGB, and ARGB color formats.
2. BorderRadius
This property allows you to get the radius's integer value or set an integer value that makes a curve on the checkbox edges. By increasing the integer value, the checkbox edges become more curved.
3. BorderThickness
This property allows you to get the thickness's integer value or set an integer value that sets width to the checkbox borders. The checkbox borders get increasingly thicker as you set a larger integer value.
4. CheckBoxColor
This property allows you to get the inner color value or set the checkbox's inner fill color. It supports the use of HEX, RGB, and ARGB color formats.
5. CheckmarkColor
This property allows you to get the color value of the tick or define the checkbox's tick icon. It supports the use of HEX, RGB, and ARGB color formats.
6. CheckmarkThickness
This property allows you to get the thickness integer value of the checkbox tick set an integer value that determines the thickness of the tick icon in the checkbox control.
7. UseBorderThicknessForCheckmark
This property allows you to get the property's boolean value or set a bool value(i.e. true or false), which when set to true, will apply the value specified in the BorderThickness
property to be applied to both the checkbox border its tick icon concurrently.
ToolTip
This property allows you to get or set tooltip text that will be displayed when the checkbox is hovered.
AllowOnHoverStates
This property allows you to get the property's boolean value or set a bool value (i.e. true or false), which when checked to true, allows the OnHoverChecked and OnHoverUnchecked states to be active at runtime. The default value is true.
1. AllowCheckBoxAnimation
This property allows you to get the property's boolean value or set a boolean value that, when set to true, causes a bouncy animation to occur during runtime check-state changes.
2. AllowCheckmarkAnimation
This property enables you to get the property's boolean value or set a boolean value that, when set to true, triggers a tick animation during theOnCheck
state event.
3. AllowBindingControlAnimation
This property allows you to get the property's boolean value or set a boolean value (i.e either true or false) which when set to true, causes the bound control to bouncy effect during runtime check-state changes.
AllowCheckBoxAnimation
must be set to true for this property to work.
1. BindingControl
This property allows you to get the bound control or set the control to bind specifically with the CheckBox. Generally, it is advised that we bind a label with the checkbox.
You may bind any other acceptable control (e.g. panels, labels, picture boxes, or user controls) as long as they are not the checkbox's parent.
2. BindingControlPosition
This property allows you to get the property's value or set the bound control position (i.e left or right).
If we want to adjust the spacing between the checkbox and its bound control, we can do so by using the Margin property. If the control is bound to the left, use the left property; if it is bound to the right, use the right property.
3. AllowBindingControlLocation
This property allows you to get the property's boolean value or set a bool value that when set to true, causes the control bound to the checkbox will adjust its position automatically whenever the checkbox’s location changes
4. AllowBindingControlColorChanges
This property allows you to get the property's bool value or set a boolean value that when set to true, causes the control bound to the checkbox to be colored during the checkbox's state changes (i.e. the bound control will be colored with colors set on OnCheck
, OnUncheck
, OnHoverChecked
, OnHoverUnchecked
and onDisabled
states).
1. CheckedChanged
This event occurs whenever the Checked property is changed. The sample code below listens to the check-state changes in the CheckBox.
CheckStateChanged
This event is triggered whenever the check state of a Bunifu checkbox changes. The following code monitors changes in the CheckBox's check-state:
3. BindingControlPositionChanged
This event is triggered anytime the bound control's position changes. The sample code below listens to CheckBox's bound control position changes.
4. BindingControlChanged
This event occurs when the checkbox is bound to a different control during runtime. The sample code below listens to the check-state changes in the CheckBox.
5. StatePropertiesChanged
This event is triggered whenever there is a property change in a current state of a checkbox. The following code below executes to a current state of a checkbox and listens for any property changes within that state
It's our hope you will enjoy Bunifu CheckBox 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.