using delegates with functions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i'm using this method with subs + it works well, but with functions, they
don't return a value. what am i doing wrong?

Private Delegate Function listview_items_countCallback() As Integer

Public Function listview_items_count() As Integer
If Me.listview.InvokeRequired Then
Me.listview.Invoke(New listview_items_countCallback(AddressOf
listview_items_count))
Else
listview_items_count = Me.listview.Items.Count
End If
End Function

thanks
 
try to use

Return Me.listview.Items.Count
instead of
listview_items_count = Me.listview.Items.Count

- Ramesh Soni
 
Back
Top