MTrackBar
Home
Components
MTrackBar
About component
Track-bars allow users to make selections from a range of values.
What has changed?
Track-bar was redesigned for better user experience on touch capable devices. Themes, accent and some nice animations were added.
How to use it?
Like other controls, MTrackBar 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 track-bar programmatically:
// Initialize track-bar first
MTrackBar trackBar = new MTrackBar();
// Set location
trackBar.Location = new Point(50, 50);
// Don't forget to add our newly created
// track-bar to form's control collection.
targetForm.Controls.Add(trackBar);
using System;
using System.Windows.Forms;
using Minimal.Components;
namespace Demo
{
public partial class MyForm : Form
{
// Initialize track-bar first
MTrackBar trackBar = new MTrackBar();
// Form constructor
public MyForm()
{
InitializeComponent();
// Set size and location
trackBar.Location = new Point(50, 50);
// Don't forget to add our newly created
// track-bar to form's control collection.
Controls.Add(trackBar);
}
}
}
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.
Class content
Assembly |
Minimal.dll |
Namespace |
Minimal.Components |
Inheritance |
UserControl |
Attributes |
Minimal.Components.Design.TrackBarDesigner |
Implements |
IMComponent |
This list doesn’t include content derived from the parent class. See Microsoft’s official UserControl class documentation for a complete list of items.
Constructors
Name |
Description |
|
MTrackBar() |
Initializes a new instance of the MTrackBar 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 theme or application wide theme. |
Theme |
Value |
Final value of the track-bar. |
int |
Minimum |
Minimum value of the track-bar. |
double |
Maximum |
Maximum value of the track-bar. |
double |
AutoHide |
True if track-bar thumb button should hide on mouse leave. |
bool |
IncreaseValueGradually |
Increases value gradually after click on value bar.. |
bool |
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 |
ValueChanged |
Fires when the Value property is changed. |
PropertyChangedEventHandler |
MaximumChanged |
Fires when the Maximum property is changed. |
PropertyChangedEventHandler |
MinimumChanged |
Fires when the Minimum property is changed. |
PropertyChangedEventHandler |
AutoHideChanged |
Fires when the AutoHide property is changed. |
PropertyChangedEventHandler |
IncreaseValueGraduallyChanged |
Fires when the IncreaseValueGradually property is changed. |
PropertyChangedEventHandler |
Methods
Name |
Description |
Returns |
Animate() |
Plays track-bar’s value animation. |
- |