title: Visual C# Error: System.Windows.Forms.Button does not contain a definition for ToInt32
body: <p>Im working on a <code>decimal</code> to <code>binary converter</code> that works perfectly on a console and then i get these errors about my core math operations:</p>
  
  <p><code>System.Windows.Forms.Button</code> does not contain a definition for <code>ToInt32</code> and no extension method <code>ToInt32</code> accepting a first argument of type <code>System.Windows.Forms.Button</code> could be found (are you missing a using directive or an assembly reference?) 
  Line:93</p>
  
  <p>No overload for method 'ToString' takes 2 arguments Line:94</p>
  
  <p>System.Windows.Forms.Button does not contain a definition for 'ToInt32' and no extension method 'ToInt32' accepting a first argument of type 'System.Windows.Forms.Button' could be found (are you missing a using directive or an assembly reference?) Line:103</p>
  
  <p>Here is the code:</p>
  
  <pre><code>    public void Convert_Click(object sender, EventArgs e)
      {
          string Input;
          bool IsNotBinary;
          string Answer;
          Start:
          Input = UserInput.Text;
          int InputLength = Input.Length;
          if (InputLength &gt; 10)
          {
              UserInput.Text = "Overflow";
              goto Start;
          }
          int Int;
          bool IsANumber = int.TryParse(Input, out Int);
          if (IsANumber == false)
          {
              UserInput.Text = "Invalid Character";
              goto Start;
          }
          IsNotBinary = Input.Contains("3");
          if (IsNotBinary == true)
          {
              goto End;
  
          }
          IsNotBinary = Input.Contains("4");
          if (IsNotBinary == true)
          {
              goto End;
  
          }
          IsNotBinary = Input.Contains("5");
          if (IsNotBinary == true)
          {
              goto End;
  
          }
          IsNotBinary = Input.Contains("6");
          if (IsNotBinary == true)
          {
              goto End;
  
          }
          IsNotBinary = Input.Contains("7");
          if (IsNotBinary == true)
          {
              goto End;
  
          }
          IsNotBinary = Input.Contains("8");
          if (IsNotBinary == true)
          {
              goto End;
  
          }
          IsNotBinary = Input.Contains("9");
      End:
  
          if (IsNotBinary == true)
          {
  
              // decimal to binary
              int InputInt = Convert.ToInt32(Input); // converts the string "Input" to the int "InputInt"
              Answer = Convert.ToString(InputInt, 2);
              UserInput.Text = Answer;
  
          }
  
          else
          {
  
              // binary to decimal
              Answer = Convert.ToInt32(Input, 2).ToString();
              UserInput.Text = Answer;
  
          }
          Console.ReadLine();
          goto Start;
      }
  
      public void QuitButton_Click(object sender, EventArgs e)
      {
          Application.Exit();
      }        
  }
  </code></pre>
  
  <p>}</p>