I'd like to make a slider control that when I press a key (lets say shift), its thumb (and its value) will drag slower than the mouse and so become more precise.
I'm still new to WPF and I don't really where to start.
Any hints?
EDIT---
Here is what I'm trying so far with horizontal slider :
Point pStart;
Point pCurrent;
private void CMiXSlider_DragDelta(object sender, DragDeltaEventArgs e)
{
if (Keyboard.IsKeyDown(Key.LeftShift))
{
pCurrent = Mouse.GetPosition(CMiXSlider);
double center = Math.Abs(pCurrent.X - pStart.X);
Value = (1.0 / CMiXSlider.ActualWidth) * center;
}
}
private void CMiXSlider_DragStarted(object sender, DragStartedEventArgs e)
{
pStart = Mouse.GetPosition(CMiXSlider);
}
it behaves almost as expected but the thumb is always at the center position between 0 and pCurrent. Looks like pStart doesn't keep its value when DragDelta is triggered.