5

I have a slider control and all I wanted is to move the slider thumb with the arrow key inputs. Right now, I could see it moves with mouse inputs and PageUp/PageDown keys. But nothing happens with the arrow keys. How can I change this behaviour in xaml?

Any help anybody could produce would highly appreciated.

Thanks

Ratheesh

Ratheesh Vijay
  • 171
  • 1
  • 3
  • 12
  • debugged the application and checked the code, public int MySpeed {get{return this.speed;}set{this.speed = value;} when pageUp/Down keys are pressed, the value is incremented/decremented and this.speed is set, but for arrow keys, it is not changed and the same value is set. Any idea why this happens? – Ratheesh Vijay Jul 26 '11 at 10:53
  • Please check the xaml code – Ratheesh Vijay Jul 26 '11 at 11:03

1 Answers1

16

The default SmallChange value for a RangeBase is 0.1. Since you are bound to an integer property I'm guessing that is getting rounded/truncated. Try setting the SmallChange to 1 and the LargeChange to something else (e.g. 10).

AndrewS
  • 6,054
  • 24
  • 31
  • Thanks man.. thanks for the reply.. U say this would work for the arrow keys? but how to change the default Smallchange value? – Ratheesh Vijay Jul 28 '11 at 05:29
  • Thanks AndrewS, it worked for me. I have given SmallChange="1" to the slider control and was able to move the slider thumb by the left/right arrow keys. Thanks man.. – Ratheesh Vijay Aug 01 '11 at 05:27