Force WPF scrollbar to only land on integer values

Viewed 1107

If I have a WPF scroll bar with both Change properties defined, why is it still possible to have a real value like 123.456 that is not a multiple of my steps?

<ScrollBar Minimum="-5000" Maximum="5000" SmallChange="1" LargeChange="25"></ScrollBar>

Is there a way to force a scroll bar to only set values of integers, multiples of the step, or both?

Most of the existing documentation on this issue seems directed towards WPF Sliders (which can use IsSnapToTickEnabled) or ScrollViewers (content controls using IScrollInfo), neither of which have equivalent solutions in ScrollBar.

1 Answers
Related