Click here to Skip to main content
15,748,930 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 20 sliders, If I change 1 slider's value then remaining 19 slider value should changed. then if i changed 18 slider value will change.same for remaining slider please help me?
Updated 7-Apr-15 23:05pm

1 solution

This is not a problem, you're just stuck defining the logic of your project. What you need is known as Binding, apart from data binding, you can bind properties of one control to other; such as Value of on Slider to the Value property of other Slider and so on.

Before you continue, please read the documentation about Data binding on MSDN[^], they would provide you enough underlying understanding of what this is in real, when you should use it, and what does it provide you with. You will be in a good company on MSDN documentations.

You can understand how to do this, from this example of mine. I will use 2 sliders (not 20) and I will bind value of second, to the value of first one. Look below,

<Slider Name="slider1" Minimum="0" Maximum="100" />
<Slider Value="{Binding ElementName=slider1, Path=Value}" Minimum="0" Maximum="100" />

Now when you will change the value of first slider, the value of the second one would change automatically; because it is now bound to the slider1. Learn more about Slider controls on MSDN[^]. You can then use the same mechanism to bind other controls to each other.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900