I have a TrackBar with values [-100,100]
this values are used in some function that accept float values between 0 and 20 (I guess)..
when TrackBar.Value = [-100, 1]
that value must converted to [0.0, 1.0]
when TrackBar.Value = ( 1, 100]
that value must converted to [1.1, 20]
what`s the formula to convert that?
I`m working at it from a while... and nothing...
Convert interval
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Hiren SoniRank #694 · 3.5K reputationPosted Dec 8, 2009, 2:42 AM EST
double d = ( (trackbar1.value/10) + 10 );
here pass value of variable d in whichever function you want to pass
Hiren SoniRank #694 · 3.5K reputationPosted Dec 8, 2009, 2:21 AM EST
Kirtan PatelRank #292 · 8.6K reputationPosted Dec 8, 2009, 4:19 AM EST
What do you mean by [1,100] as track bar have only one Value at a time ??
private void trackBar1_Scroll(object sender, EventArgs e)
{
label1.Text = ((float)Math.Abs(trackBar1.Value)/10).ToString();
}