Using the TrackBar Control


Using the TrackBar Control

The TrackBar control is a special slider control that allows the user to select a numeric value by changing the position of the slider. The TrackBar is controlled mainly by three properties: Minimum , Maximum , and Value . Given our earlier discussions, these values are self-explanatory.

The TrackBar exposes a few additional properties that control the appearance and behavior of the TrackBar . The Orientation property determines whether the TrackBar is oriented on the horizontal or vertical axis. The TickFrequency property defines the distance between the tick marks along the slider. By default the TickFrequency is set to one. The SmallChange and LargeChange properties define increment values. SmallChange defines how much the Value is incremented when the user presses one of the Pocket PC navigation pad arrow keys. The LargeChange property defines how much the Value is incremented when the user clicks the TrackBar on either side of the slider.

When the TrackBar controls value is changed, a ValueChanged event is fired . You can handle this event to update whatever properties that are linked to the TrackBar . Figure 3.14 shows two TrackBar s that are identical except that one is oriented vertically and the other horizontally. The horizontal TrackBar controls the vertical, meaning that the value of the vertical TrackBar control will change to match the value of the horizontal TrackBar control.

Figure 3.14. An application that showcases the TrackBar control running on the Pocket PC 2002 emulator.

graphics/03fig14.jpg



Microsoft.NET Compact Framework Kick Start
Microsoft .NET Compact Framework Kick Start
ISBN: 0672325705
EAN: 2147483647
Year: 2003
Pages: 206

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net