Hi,

I'm working on this Project.

and I'm trying to use a Slide bar instead of just showing radio buttons

http://www.imgcentre.com/images/view/9dde627466.png

I'm trying to replace them with a Slider bar and some how show the value (1 - 100)

so, can someone please tell me how can I .... ?

Thanks.

Recommended Answers

All 2 Replies

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.