MLabel
Home
Components
MLabel
About component
MLabel controls are typically used to provide descriptive text for a control. For example, you can use a label to add additional text for a text-box control to inform the user about the type of data expected in the control.
What has changed?
In addition to all standard features was also added support for themes and multiple render modes.
How to use it?
Like other controls, MLabel 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 a label programmatically:
// Initialize label first
MLabel label = new MLabel();
// Set location
label.Location = new Point(50, 50);
// Add text (optional)
label.Text = "Label text";
// Don't forget to add our newly created
// check-box to form's control collection.
targetForm.Controls.Add(label);
using System;
using System.Windows.Forms;
using Minimal.Components;
namespace Demo
{
public partial class MyForm : Form
{
// Initialize button first
MLabel label = new MLabel();
// Form constructor
public MyForm()
{
InitializeComponent();
// Add size and location
label.Location = new Point(50, 50);
// Add text (optional)
label.Text = "Label text";
// Don't forget to add our newly created
// button to form's control collection.
Controls.Add(label);
}
}
}
Code example asumes, that targetForm variable is form where you want to have your color-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.
Label types
You can switch between multiple render types using the Type property.
// Standard render type
label.Type = LabelType.Standard;
// Alternate render type
label.Type = LabelType.Alternate;
// Accent render type
label.Type = LabelType.Accent;
Class content
Assembly |
Minimal.dll |
Namespace |
Minimal.Components |
Inheritance |
Label |
Attributes |
Minimal.Components.Design.LabelDesigner |
Implements |
IMComponent |
This list doesn’t include content derived from the parent class. See Microsoft’s official Label class documentation for a complete list of items.
Constructors
Name |
Description |
|
MButton() |
Initializes a new instance of the MLabel 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 |
Type |
Type of the label. |
LabelType |
CustomTheme |
Component’s custom theme. Will override default parent M-form theme or application wide theme. |
Theme |
Fields
Name |
Description |
Type |
- |
- |
- |
Events
Name |
Description |
Type |
AccentChanged |
Fires when the Accent property is changed. |
PropertyChangedEventHandler |
TypeChanged |
Fires when the Type property is changed. |
PropertyChangedEventHandler |
CustomThemeChanged |
Fires when the CustomTheme property is changed. |
PropertyChangedEventHandler |
Methods
Name |
Description |
Returns |
- |
- |
- |