I looked all over Google can no one asked this question or there isn’t any answer for this. What i am trying to do is to make a slider‘s maximum value the text in my textbox, i have tried to to do this:
This code is in my textBox1_TextChanged Event
textBox1.Text = slider1.Maximum.ToString();
and this:
this.slider1.Maximum = textBox1.Text;
And some other ones but it doesn’t work, it says:
Cannot Implicitly Convert 'String' to 'Int'
If anyone knows how to do this please post it here or show me where i can find the code.
Second Problem
I have another problem, i have this code:
private void slider1_ValueChanged(object sender, EventArgs e)
{
textBox1.Text = slider1.Value.ToString();
}
It shows up the value of the slider just fine but the slider piece that you grab stays at the end, if this is too confusing here is my problem:
When i grab the slider the text in textBox1 is the slider’s value.
The problem is is that the slider part that you grab to change the value stays at the end. does anyone know how to show the grabber part at the real value instead of the end?
You should use Int32.TryParse:
And if try parse fails provide an error message explaining why..