title: program doesnt stop if return is false?
body: <p>here is my code:</p>
  
  <pre><code>namespace WindowsFormsApplication2
  {
  public partial class Form2 : Form
  {
      private void Form2_Load(object sender, EventArgs e)
      {
          pictureBox2.SizeMode = PictureBoxSizeMode.Zoom;
      }
  
      public Form2()
      {
          InitializeComponent();
      }
      public bool radioButtons()
      {
          if (!userRadioButton.Checked &amp;&amp; !adminRadioButton.Checked)
          {
              MessageBox.Show("You must select an account type");
              return false;
          }
          else
          {
              return true;
          }
      }
  
      public void button1_Click(object sender, EventArgs e)
      {
          bool a = radioButtons();
          if (a == true)
          {
              string userName = userNameBox.Text;
              string password = passwordBox.Text;
              var userNames = File.ReadAllLines(@"C:\Other\myFile.txt");
              checkUsernameValid();
              checkUsernameNotExist();
              checkPasswordsValid();
              checkPasswordsMatch();
              allOK();
          }   
      } 
      public void mySW()
      {
           string path = @"C:\Other\myFile.txt";
          string userName = userNameBox.Text;
          string password = passwordBox.Text;
          using (StreamWriter writer = new StreamWriter(path, true))
          {
              writer.WriteLine("Username and Password: {0} {1}",userName,password);
              writer.WriteLine();
              writer.Close();
              writer.Dispose();
          }
          MessageBox.Show("Thanks for registering! \n\nYou may now log in!","Registration SuccessFul");
          Application.OpenForms[0].Show();
          this.Close();
      }
      public bool checkUsernameNotExist()
      {
          if (userNameBox.Text == "")
          {
              MessageBox.Show("Username cannot be empty", "Invalid Username Entry");
              return false;
          }
          else
              return true;
      }
      public bool checkPasswordsMatch()
      {
          if (!passwordBox.Text.Equals(repeatPasswordBox.Text))
          {
              MessageBox.Show("Sorry, your passwords do not match, try again", "Password Error");
              passwordBox.Text = "";
              repeatPasswordBox.Text = "";
              return false;
          }
          else
              return true;
      }
      public void checkUsernameValid()
      {
          if (userNameBox.Text.Contains("Username: " + userNameBox.Text))
          {
              MessageBox.Show("Sorry, that user name is not available, try again", "Invalid Username Entry");
              userNameBox.Text = "";
              passwordBox.Text = "";
              repeatPasswordBox.Text = "";
              return false;
          }
          else
              return true;
      }
      public void allOK()
      {
          if (!userNameBox.Text.Contains("Username: " + userNameBox.Text) &amp;&amp; passwordBox.Text == repeatPasswordBox.Text)
              {
                  mySW();
              }
      }
      public void checkPasswordsValid()
      {
          if (passwordBox.Text == "")
              {
                  MessageBox.Show("Password fields cannot be empty","Password Error");
              }
      }
     }
  }
  </code></pre>
  
  <p>now the problem is if, for example, the username is not valid, and a message box shows up, it then shows a password box, then a thanks for registering box. how do i get the program to stop if one of the results shows a box and returns false???</p>