title: Enable button C#
body: <p>I have an user control calling a method on my main form and this method should enable a button (by default this button is disabled) on the same form, but it's not working.</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
      {
          Form1 fr = new Form1();
          fr.login(textBox1.Text, textBox2.Text);
      }
  </code></pre>
  
  <p>And here is my method</p>
  
  <pre><code> public void login(string username, string password)
      {
          Connect();
          sendMessage("LoginAction,Username=" + username + "UserPassword=" + password);
      }
  </code></pre>
  
  <p>Here is where the button is enabled</p>
  
  <pre><code>private void commandInterpreter(string Message)
      {
          if(Message.Contains("LoginSuccess,") == true)
          {
              name = Message.Remove(Message.IndexOf("LoginSuccess,Name="), 18);
              Bt2En = true;
          }
      }
  </code></pre>
  
  <p>Here is where I'm exposing my button properties:</p>
  
  <pre><code>public bool Bt2En
      {
          get { return button2.Enabled; }
          set { button2.Enabled = value; }
      }
  </code></pre>