Values on trackbar

Nicolai picture Nicolai · Dec 6, 2011 · Viewed 9.3k times · Source

Quick question; In C#, Windows Forms, is it not possible, to have a System.Windows.Forms.TrackBar show all its values, next to its ticks? I have not been able to find any way of doing this, which suprises me abit. Is there another way, to get this behavior? I really would like to avoid, creating 25 labels, and writing on them.

Answer

Alex picture Alex · Dec 6, 2011

You can achieve this by creating a User Control with the TrackBar in it and generate labels at runtime (placement of the labels goes according to tick values).

I did something similar some time ago with a ProgressBar instead of TrackBar, but the logic should still apply. Don't have code at hand right now I'm afraid, will try to dig it up.