title: How to convert a MaskedTextBox value to TimeSpan?
body: <p>So far I've tried this:</p>
  
  <pre><code>try
  {
      TimeSpan durtime = TimeSpan.Parse(timeDur.ToString());
  }
  catch (FormatException)
  {
      MessageBox.Show("Bad Format", timeDur.ToString());
  }
  </code></pre>
  
  <p><code>timeDur</code> is a MaskedTextBox with a mask of type <code>__:__</code> (Validating type DateTime).</p>
  
  <p>When I try to convert the <code>timedur</code> MaskedTextBox into a string format, it gives me an exception of type System.FormatException: </p>
  
  <blockquote>
    <p>"The string was not recognized as a valid TimeSpan."</p>
  </blockquote>