Thumb.DragStarted 事件

定义

Thumb 控件接收逻辑焦点和鼠标捕获时发生。

public:
 event System::Windows::Controls::Primitives::DragStartedEventHandler ^ DragStarted;
public event System.Windows.Controls.Primitives.DragStartedEventHandler DragStarted;
member this.DragStarted : System.Windows.Controls.Primitives.DragStartedEventHandler 
Public Custom Event DragStarted As DragStartedEventHandler 

事件类型

示例

以下示例演示如何将 事件的Thumb事件处理程序DragStarted分配给控件,以及如何定义事件处理程序。 有关完整示例,请参阅 Thumb 拖动功能示例

<Thumb Name="myThumb" Canvas.Left="80" Canvas.Top="80" Background="Blue" 
      Width="20" Height="20" DragDelta="onDragDelta" 
      DragStarted="onDragStarted" DragCompleted="onDragCompleted"
      />
void onDragStarted(object sender, DragStartedEventArgs e)
{
    myThumb.Background = Brushes.Orange;
}
Private Sub onDragStarted(ByVal sender As Object, ByVal e As DragStartedEventArgs)
    myThumb.Background = Brushes.Orange
End Sub

注解

Thumb当用户按下鼠标左键同时将鼠标指针悬停在 上时,Thumb控件接收焦点和鼠标捕获。

路由事件信息

标识符字段 DragStartedEvent
路由策略 鼓 泡
委托 DragStartedEventHandler

适用于

另请参阅