The Thumb control can be included in another control, such as a ScrollBar or Slider control, to let the user change the control's value. The Thumb can also be used to resize controls. For example, a Thumb control in the corner of a window can provide a location for the user to click with the mouse to start a resize operation.
Thumb provides DragStarted, DragCompleted and DragDelta events to manage drag operations associated with the mouse pointer. When the user presses the left mouse button, the Thumb control receives logical focus and mouse capture, and the DragStarted event is raised. While the Thumb control has focus and mouse capture, the DragDelta event can be raised multiple times without limit. When the user releases the left mouse button, the Thumb control loses mouse capture and the DragCompleted event is raised.
The event information provides a change in position, but does not reposition the Thumb. You must manually change or reposition the Thumb or any other elements that you want to resize or change as a result of the drag operation. The Thumb control does not provide drag-and-drop functionality.
A Thumb control can receive mouse capture, but cannot receive keyboard focus. Therefore, the IsKeyboardFocused property that corresponds to keyboard focus is set to false. This value overrides the parent class Control that sets this property to true.
To provide drag capability, class handling is provided for the MouseLeftButtonDown, MouseLeftButtonUp and MouseMove events. For more information, see the OnMouseLeftButtonDown, OnMouseLeftButtonUp and OnMouseMove methods.
When a Thumb is part of a Track control that scrolls content in a viewable area, or viewport, the size of the Thumb reflects the size of the viewport. For more information, see the Track class. The following illustration shows a Thumb control that is part of a ScrollBar control.
.jpg)
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. For more information, see Themes.