title: Message Box is not appearing in simple compare text box strings program
body: <p>very beginner programmer here. I am creating an application that displays 2 text boxes. The information is entered via barcode scanner. When both text boxes are filled it will then either show a green checkmark or show a message box error that explains that the barcodes do not match.</p>
  
  <pre><code>private void Form1_Load(object sender, EventArgs e)
          {
              //label1 = your tick
              label2.Visible = false;
              label3.Visible = false;
          }
  
          private void textBox1_TextChanged(object sender, EventArgs e)
          {
              //if same, show, if different, show message box error
              if (string.Compare(textBox1.Text, textBox2.Text, true) == 0)
                  label2.Visible = true;
              else
                  label2.Visible = false;
              if (string.Compare(textBox1.Text, textBox2.Text, false) == 0)
                  MessageBox.Show("Barcodes Do Not Match")
                  //label3.Visible = true;
          }
  
          private void textBox2_TextChanged(object sender, EventArgs e)
          {
              //if same, show, if different, show message box error
              if (string.Compare(textBox1.Text, textBox2.Text, true) == 0)
                  label2.Visible = true;
  
              else
                  label2.Visible = false;
              if (string.Compare(textBox1.Text, textBox2.Text, false) == 0)
                  //label3.Visible = false;
               MessageBox.Show("Barcodes Do Not Match");
  
                  //label3.Visible = true;
  </code></pre>
  
  <p>If I do something like this:</p>
  
  <pre><code>private void textBox2_TextChanged(object sender, EventArgs e)
  
  
   {
          //if same, show, if different, show message box error
          if (string.Compare(textBox1.Text, textBox2.Text, true) == 0)
              label2.Visible = true;
  
          else
            //  label2.Visible = false;
         // if (string.Compare(textBox1.Text, textBox2.Text, false) == 0)
              MessageBox.Show("Barcodes Do Not Match");
          //label3.Visible = false;
  </code></pre>
  
  <p>I get the text box not filling completely from the barcode and the message box kind of pops up but not before moving the cursor out of the text box. </p>
  
  <p>I've tried a few different things. With this coding I'm getting the check mark and no problems with the text entered(which was getting cut off before) but still no Message Box. I'm pretty new to coding in general so any help is much appreciated. Thank you for the help. </p>