if(textBox1.Text == "") {
      MessageBox.Show("You must enter a name.", "Name Entry Error",
         MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
   }
   else {
      // Code to act on the data entered would go here.
   }