Esta documentación está archivada y no tiene mantenimiento.

Thumb (Clase)

Represents a control that lets the user drag and resize controls.

Espacio de nombres: System.Windows.Controls.Primitives
Ensamblado: PresentationFramework (en presentationframework.dll)
Espacio de nombres XML:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

[LocalizabilityAttribute(LocalizationCategory.NeverLocalize)] 
public class Thumb : Control
/** @attribute LocalizabilityAttribute(LocalizationCategory.NeverLocalize) */ 
public class Thumb extends Control
LocalizabilityAttribute(LocalizationCategory.NeverLocalize) 
public class Thumb extends Control

The Thumb control lets the user change the value of a control, such as a ScrollBar or Slider control.

The following illustration shows a Thumb control that is part of a ScrollBar control.

Scrollbar illustration

The Thumb control provides the infrastructure 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. These events are used to provide drag functionality for a Thumb in a Slider and ScrollBar control.

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.

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.

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.

<Thumb Name="myThumb" Canvas.Left="80" Canvas.Top="80" Background="Blue" 
      Width="20" Height="20" DragDelta="onDragDelta" 
      DragStarted="onDragStarted" DragCompleted="onDragCompleted"
      />

System.Object
   System.Windows.Threading.DispatcherObject
     System.Windows.DependencyObject
       System.Windows.Media.Visual
         System.Windows.UIElement
           System.Windows.FrameworkElement
             System.Windows.Controls.Control
              System.Windows.Controls.Primitives.Thumb
                 System.Windows.Controls.GridSplitter

Los miembros estáticos públicos (Shared en Visual Basic) de este tipo son seguros para la ejecución de subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.

Microsoft .NET Framework 3.0 es compatible con Windows Vista, Microsoft Windows XP SP2 y Windows Server 2003 SP1.

.NET Framework

Compatible con: 3.0
Mostrar: