title: Delegate string values being evaluating as DateTIme?
body: <p>I am using a delegate from threaded classes (instantiated objects) to call a waitgif method in which I am maintaining a dictionary of my own thread names.  (don't worry about ways to monitor active and closed threads -- as this is a custom method that I actually do a lot of bookkeeping with).  </p>
  
  <p>The problem is that the string ("currentwaitgifname") that is being sent to the delegate is being evaluated as DateTime and throwing an exception, even though the delegate has defined string definitions which are sent to method.   Do I need to look into predicates?</p>
  
  <pre><code>         Public Delegate Sub ShowWaitGifDelegate(ByRef CurrentWaitGifName As String, ByVal onoff As Boolean, ByVal left As Integer, ByVal top As Integer)
           Public NumWaitGifs As Integer = 0
           Public currentwaitgifname As String = ""
  
  
           Dim main As Form1 = CType(Application.OpenForms(0), Form1)
           main.Invoke(New ShowWaitGifDelegate(AddressOf main.waitgifimg),  currentwaitgifname, False, 0, 0) ' Exception here, with string currentwaitgifname being evaluated against DateTime
  
           Public Sub waitgifimg(ByRef currentwaitgifname As String, ByVal onoff As Boolean, ByVal left As Integer, ByVal top As Integer)
              If currentwaitgifname = "" Then Exit Sub
              If onoff = True Then
                  NumWaitGifs += 1
                  currentwaitgifname = wgname + CStr(NumWaitGifs)
                  Call addthreadtodic(currentwaitgifname)
              End If
              If onoff = False Then
                  Call removethreadfromdic(currentwaitgifname)
              End If
          End Sub
  
          Public Sub addthreadtodic(ByVal currentwaitgifname)
              If dicWaitgifThreads.ContainsKey(currentwaitgifname) = False Then
                  dicWaitgifThreads.Add(currentwaitgifname, "")
              End If
              My.Settings.dicWaitgifThreads.Add(currentwaitgifname.ToString)
              My.Settings.Save()
          End Sub
  
          Public Sub removethreadfromdic(ByVal currentwaitgifname)
              If currentwaitgifname = "" Then Exit Sub
              For Each kvp As KeyValuePair(Of String, String) In dicWaitgifThreads
                  dicWaitgifThreads.RemoveAt(kvp.Key.ToString)
                  My.Settings.dicWaitgifThreads.RemoveAt(kvp.Key)
                  GoTo savesettings
              Next
      savesettings:
              My.Settings.Save()
          End Sub
  </code></pre>