title: ArgumentOutOFRangeException when comparing times
body: <p>I'm working on a simple project to use at work (logistics company) for my colleagues and me. </p>
  
  <p>Let me explain a little to make my question a bit easier. </p>
  
  <p>Each Route represents a country that has a deadline. In this example I use Route 114. Route 114 represents the Netherlands and the orders should be finished at xx:xx:xx local time.
  I'm using a DateTimePicker so the user can select the deadline and receive a warning if the ProgressBar reaches 70% (in this case a label turns red).</p>
  
  <p>The code I have works so far, but sometimes it throws out an error saying: </p>
  
  <p><strong>Value of '-4758' is not valid for 'Maximum'. 'Maximum' must be greater
  than or equal to 0. Parameter name: Maximum</strong></p>
  
  <p>I'm an amateur, but it looks like the time is counting backwards in some cases and thus results in a negative Value. </p>
  
  <pre><code>    Public Class Deadlines
  
      Private Route114Deadline As Boolean = False
  
      Public Function GetTimeDifference(ByVal EndTime As DateTime, ByVal StartTime As DateTime) As Integer
          Dim span As TimeSpan = EndTime.TimeOfDay - StartTime.TimeOfDay
          Dim result As Integer = CInt(span.TotalSeconds)
          Return result
      End Function
  
      Private Sub tm114_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tm114.Tick
          ' ROUTE 114 '
          Dim value114 As Integer = pb114.Maximum - GetTimeDifference(DateTimePicker1.Value, DateTime.Now)
          If value114 &gt; pb114.Maximum Then
              tm114.Stop()
          End If
          If value114 &lt; pb114.Minimum Then
              tm114.Stop()
              Exit Sub
          End If
          pb114.Value = value114
          If Not Route114Deadline AndAlso pb114.Value &gt;= pb114.Maximum * 0.7 Then
              Route114Deadline = True
              lb114.ForeColor = Color.Red
          End If
      End Sub
  
      Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
          pb114.Minimum = 0
          pb114.Maximum = GetTimeDifference(DateTimePicker1.Value, DateTime.Now)
          tm114.Start()
      End Sub
  End Class
  </code></pre>