T
Terry Olsen
How do I get this to work? It always returns False, even though I can see
"This is True!" in the debug window. Do I have to invoke functions
differently than subs?
Private Delegate Function IsLvItemCheckedDelegate(ByVal ClientID As Integer)
As Boolean
Private Function IsLvItemChecked(ByVal ClientID As Integer) As Boolean
If lvServers.InvokeRequired = True Then
lvServers.Invoke(New IsLvItemCheckedDelegate(AddressOf IsLvItemChecked),
ClientID)
Else
For i As Integer = 0 To lvServers.CheckedItems.Count - 1
If CInt(lvServers.CheckedItems(i).SubItems(1).Text) = ClientID Then
Debug.WriteLine("This is true!")
Return True
End If
Next
Return False
End If
End Function
"This is True!" in the debug window. Do I have to invoke functions
differently than subs?
Private Delegate Function IsLvItemCheckedDelegate(ByVal ClientID As Integer)
As Boolean
Private Function IsLvItemChecked(ByVal ClientID As Integer) As Boolean
If lvServers.InvokeRequired = True Then
lvServers.Invoke(New IsLvItemCheckedDelegate(AddressOf IsLvItemChecked),
ClientID)
Else
For i As Integer = 0 To lvServers.CheckedItems.Count - 1
If CInt(lvServers.CheckedItems(i).SubItems(1).Text) = ClientID Then
Debug.WriteLine("This is true!")
Return True
End If
Next
Return False
End If
End Function