Gets or sets a value indicating whether this control should redraw its surface using a secondary buffer to reduce or prevent flicker; however, this property has no effect on the TrackBar control (Overrides Control.DoubleBuffered.)

Gets a value indicating whether the caller must call an invoke method when making method calls to the control because the caller is on a different thread than the one the control was created on. (Inherited from Control.)

Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. (Inherited from Control.)

Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. (Inherited from Control.)

Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. (Inherited from Control.)

Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. (Inherited from Control.)

This method is called by the control when any property changes. Inheriting controls can override this method to get property change notification on basic properties. Inheriting controls must call base.propertyChanged. (Overrides Control.OnBackColorChanged(EventArgs).)

The TrackBar is a scrollable control similar to the ScrollBar control. You can configure ranges through which the value of the Value property of a track bar scrolls by setting the Minimum property to specify the lower end of the range and the Maximum property to specify the upper end of the range.

The LargeChange property defines the increment to add or subtract from the Value property when clicks occur on either side of the scroll box. The track bar can be displayed horizontally or vertically.

You can use this control to input numeric data obtained through the Value property. You can display this numeric data in a control or use it in code.

using System;
using System.Drawing;
using System.Windows.Forms;
publicclass Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TrackBar trackBar1;
private System.Windows.Forms.TextBox textBox1;
[STAThread]
staticvoid Main()
{
Application.Run(new Form1());
}
public Form1()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.trackBar1 = new System.Windows.Forms.TrackBar();
// TextBox for TrackBar.Value update.this.textBox1.Location = new System.Drawing.Point(240, 16);
this.textBox1.Size = new System.Drawing.Size(48, 20);
// Set up how the form should be displayed and add the controls to the form.this.ClientSize = new System.Drawing.Size(296, 62);
this.Controls.AddRange(new System.Windows.Forms.Control[] {this.textBox1,this.trackBar1});
this.Text = "TrackBar Example";
// Set up the TrackBar.this.trackBar1.Location = new System.Drawing.Point(8, 8);
this.trackBar1.Size = new System.Drawing.Size(224, 45);
this.trackBar1.Scroll += new System.EventHandler(this.trackBar1_Scroll);
// The Maximum property sets the value of the track bar when// the slider is all the way to the right.
trackBar1.Maximum = 30;
// The TickFrequency property establishes how many positions// are between each tick-mark.
trackBar1.TickFrequency = 5;
// The LargeChange property sets how many positions to move// if the bar is clicked on either side of the slider.
trackBar1.LargeChange = 3;
// The SmallChange property sets how many positions to move// if the keyboard arrows are used to move the slider.
trackBar1.SmallChange = 2;
}
privatevoid trackBar1_Scroll(object sender, System.EventArgs e)
{
// Display the trackbar value in the text box.
textBox1.Text = "" + trackBar1.Value;
}
}