title: Windows Forms: 'Input string was not in a correct format' error
body: <p>I am creating a webpage re-loader and I am trying to get number of reload using input from user but I am not able to get number of input from user.</p>
  
  <p>I am trying to get user input in <code>textBox2.Text</code>, but I am having this error:</p>
  
  <pre><code>input string was not in a currect format
  </code></pre>
  
  <p>This error is in this line <code>kkk = System.Int32.Parse(textBox2.Text);</code></p>
  
  <p>please help me how to get user input properly in an <code>int</code> value.</p>
  
  <p>this is my program code:</p>
  
  <pre><code>public partial class Form1 : Form
  {
      public  int kkk;
  
      public Form1()
      {
          InitializeComponent();
      }
  
      private void progressBar1_Click(object sender, EventArgs e)
      {
  
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
          if (progressBar1.Value != kkk)
          {
              do
              {
                  try
                  {
                      webBrowser1.Navigate(textBox1.Text);
                      while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
                      {
                          Application.DoEvents();
                          if(webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                          {
                              progressBar1.Value = progressBar1.Value + 1;
                          }
                      }
                      MessageBox.Show("Loaded");
                  }
                  catch(Exception)
                  {
                      MessageBox.Show("failed");
                  }
              }
              while(progressBar1.Value !=kkk);
          }   
      }
  
      private void Form1_Load(object sender, EventArgs e)
      {
          kkk = System.Int32.Parse(textBox2.Text);
          progressBar1.Maximum = kkk;        
      }
  
      private void textBox1_TextChanged(object sender, EventArgs e)
      {
  
  }
  </code></pre>