MCheckBox
Home
Components
MCheckBox
About component
MCheckBox allows users to complete tasks that involve making choices such as selecting options, or switching settings on or off. Check-box controls are found on screens that ask users to make decisions or declare preferences such as settings or dialogs.
What has changed?
MCheckBox now supports themes and accent color. In addition, on-click animations were added.
How to use it?
Like other controls, MCheckBox can be simply droped from toolbox on the form. If you are not using IDE with integrated form designer (like Visual Studio), you can always create check-box programmatically:
// Initialize check-box first
MCheckBox box = new MCheckBox();
// Set location
box.Location = new Point(50, 50);
// Don't forget to add our newly created
// check-box to form's control collection.
targetForm.Controls.Add(box);
using System;
using System.Windows.Forms;
using Minimal.Components;
namespace Demo
{
public partial class MyForm : Form
{
// Initialize check-box first
MCheckBox box = new MCheckBox();
// Form constructor
public MyForm()
{
InitializeComponent();
// Set size and location
box.Location = new Point(50, 50);
// Don't forget to add our newly created
// check-box to form's control collection.
Controls.Add(box);
}
}
}
Code example asumes, that targetForm variable is form where you want to have your combo-box placed. If you are working inside a class derived from System.Windows.Forms.Form, you can of course replace targetForm variable with this keyword or in latest version of C# omit form reference completely. See second example above. Check-box state can be obtained using Checked property:
bool privateMode = box.Checked;
Class content
Assembly |
Minimal.dll |
Namespace |
Minimal.Components |
Inheritance |
CheckBox |
Attributes |
Minimal.Components.Design.CheckBoxDesigner |
Implements |
IMComponent |
This list doesn’t include content derived from the parent class. See Microsoft’s official CheckBox class documentation for a complete list of items.
Constructors
Name |
Description |
|
MCheckBox() |
Initializes a new instance of the MCheckBox class. |
|
Properties
Name |
Description |
Type |
Component |
Handles life-cycle of the M-Component. |
MComponent |
Accent |
Component's accent color. Main visible color of the component. |
Color |
CustomTheme |
Component's custom theme. Will override default parent M-form or application-wide theme. |
Theme |
Fields
Name |
Description |
Type |
- |
- |
- |
Events
Name |
Description |
Type |
AccentChanged |
Fires when the Accent property is changed. |
PropertyChangedEventHandler |
CustomThemeChanged |
Fires when the CustomTheme property is changed. |
PropertyChangedEventHandler |
Methods
Name |
Description |
Returns |
- |
- |
- |