The 'Value Property of the TrackBar is continuous from 'MinimumValue to 'MaximumValue.
To simulate detents (snap-to-values) you need to implement a TrackBar 'ValueChanged EventHandler like this:
private int smallChangeValue = 5;
private int trackValue;
private bool blockRecursion = false;
private void trackBar1_ValueChanged(object sender, EventArgs e)
{
if (blockRecursion) return;
trackValue = trackBar1.Value;
if (trackValue % smallChangeValue != 0)
{
trackValue = (trackValue / smallChangeValue) * smallChangeValue;
blockRecursion = true;
trackBar1.Value = trackValue;
blockRecursion = false;
}
}
If you examine what's happening here, you can see this is just doing a simple form of rounding-off (rounding-down actually) of the TrackBar value.
note #1: in this example the setting a flag to block recursion is not really necessary; the reason this is shown is in case you want to do a bit more sophisticated handling such as: examining the modulo remainder of value and small-change value, and, in case it's closer to the next value, rounding-up.