Thumb DragStarted and DragCompleted event handler : Thumb « Windows Presentation Foundation « C# / CSharp Tutorial






<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="Thumb_wcp.Pane1">
  <StackPanel>
    <Thumb Name="myThumb" Background="Blue" 
          Width="20" Height="20" 
          DragStarted="onDragStarted" DragCompleted="onDragCompleted"/>
  </StackPanel>
</Canvas>

//File:Window.xaml.cs

using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Documents;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Data;
using System.Windows.Media;

namespace Thumb_wcp
{
    public partial class Pane1 : Canvas
    {

        void onDragStarted(object sender, DragStartedEventArgs e)
        {
            myThumb.Background = Brushes.Orange;
        }
        void onDragCompleted(object sender, DragCompletedEventArgs e)
        {
            myThumb.Background = Brushes.Blue;
        }
    }
}
WPF Thumb Drag Started And Drag Completed Event Handler








24.25.Thumb
24.25.1.Use a Thumb to resize a Canvas control by responding to the DragDelta event.Use a Thumb to resize a Canvas control by responding to the DragDelta event.
24.25.2.Thumb DragStarted and DragCompleted event handlerThumb DragStarted and DragCompleted event handler