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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top