title: C# button click and unclick actions
body: <p>I have a button(named: open port) when it clicked the following code executed:</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)     
  {
     try
     {
        if (!serialPort1.IsOpen)
        {    
            serialPort1.Open();                         
        }
        else
        {
           MessageBox.Show("Port is Open by other party!");    
        }   
     }
     catch (UnauthorizedAccessException ex)
     {
        MessageBox.Show(ex.Message);
     }
  }
  </code></pre>
  
  <p>what I want to do is :</p>
  
  <ol>
  <li>The button keep clicked and its name changes to (close port)</li>
  <li><p>I press it and I want it to perform the following code:</p>
  
  <pre><code>serialPort1.Close();
  Form1 myForm = new Form1();
  this.Close();
  </code></pre></li>
  </ol>
  
  <p>can you help me?</p>