public ref class ScrollBar : System::Windows::Controls::Primitives::RangeBase [System.Windows.Localizability(System.Windows.LocalizationCategory.NeverLocalize)] [System.Windows.TemplatePart(Name="PART_Track", Type=typeof(System.Windows.Controls.Primitives.Track))] public class ScrollBar : System.Windows.Controls.Primitives.RangeBase [<System.Windows.Localizability(System.Windows.LocalizationCategory.NeverLocalize)>] [<System.Windows.TemplatePart(Name="PART_Track", Type=typeof(System.Windows.Controls.Primitives.Track))>] type ScrollBar = class inherit RangeBase Public Class ScrollBar Inherits RangeBase Inheritance Attributes LocalizabilityAttribute TemplatePartAttribute The following example shows how to create a horizontal ScrollBar that has a range of values between 0 and 100. <ScrollBar Orientation="Horizontal" Width ="4in" Scroll="OnScroll" Minimum="1" Maximum="100" />The following illustration shows a ScrollBar control. The ScrollBar control contains a Track control. The Track control consists of a Thumb control and two RepeatButton controls. You can increase and decrease the Value property of the ScrollBar control by pressing the RepeatButton controls or by moving the Thumb. The default range of values for the Value property is from 0 to 1. The Value represents the linear distance of the Thumb between the endpoints of the ScrollBar. You can change the default range of values by setting the Minimum and Maximum properties. The Orientation property determines whether the ScrollBar is displayed horizontally or vertically, and you must define this property for the ScrollBar control to appear. The Track in a ScrollBar is oriented so that values increase from top to bottom for a vertical ScrollBar or from left to right for a horizontal ScrollBar. The Track properties in the following table are the binding targets for the corresponding ScrollBar properties when the Track property is not explicitly defined. If you explicitly define the Track property, the binding does not occur. You can access the Track control of a ScrollBar control by using the Track property. To display UIElement content inside a box that has scroll bars, use the ScrollViewer control. To apply the same property settings to multiple ScrollBar controls, use the Style property. You can modify the default ControlTemplate to give the control a unique appearance. For more information about creating a ControlTemplate, see Customizing the Appearance of an Existing Control by Creating a ControlTemplate. To see the parts and states that are specific to the ScrollBar, see ScrollBar Styles and Templates. Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. Constructors
FieldsProperties
Methods
EventsExplicit Interface ImplementationsApplies to
|