2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Evil Genius
2

Just add a trackbar with a min of 1 and a max of 4 then add a event handler for onchanged and update a label by dividing its max value by its current value you will get a percentage as a decimal, then multiply by 100 and add a % sign.

label1.Text = ((trackBar.Value / trackBar.Maximum) * 100) + "%";

if the slider was at 2, with a max of 4 then 2/4 = .5 and .5 X 100 = 50

Anyway, I am including a working project Example in VisualStudio 2008 Format.

Edited by Diamonddrake: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.