title: How to handle null or invalid textbox input?
body: <p>I'm trying to prevent a user from entering no value in a text box so as to prevent an error during code execution.</p>
  
  <p>The text box values are assigned a default value like this:</p>
  
  <pre><code>        wrkTbx.Text = "00 : 00 : 00 : 000";
          restTbx.Text = "00 : 00 : 00 : 000";
  </code></pre>
  
  <p>This is how I'm trying to handle the user inputting no value in the textbox but the code still runs and doesn't show the message box to signal no input.</p>
  
  <p>Does anyone know how handle the null input? as the below code doesn't work.</p>
  
  <pre><code> //Assign text box time string to string variables.
      //check if string is empty.
      if (String.IsNullOrEmpty(wrkTbx.Text) &amp;&amp; String.IsNullOrEmpty(restTbx.Text))
      {
          MessageBox.Show("Please enter a work/rest interval");
  
      }
      else
      {
          rstString = restTbx.Text;
          wrkString = wrkTbx.Text;
  
      }
  </code></pre>