No overload for method 'GetIconIndex' takes '2' argument


/ Published in: C#
Save to your folder(s)

I try to call vb.net function in c#.The function pass parameter ref and boolean. It is call in vb.net directly .how can i call in c#.


Copy this code and paste it in your HTML
  1. VB.net :
  2.  
  3. Public Shared Function GetIconIndex(ByRef item As CShItem, _
  4. Optional ByVal GetOpenIcon As Boolean = False, _
  5. Optional ByVal GetSelectedIcon As Boolean = False _
  6. ) As Integer
  7.  
  8.  
  9. C# :
  10. public static int GetIconIndex(ref CShItem item, bool GetOpenIcon, bool GetSelectedIcon);
  11.  
  12.  
  13. Call like:
  14.  
  15. Vb.net:
  16.  
  17. lvi.ImageIndex = SystemImageListManager.GetIconIndex(lvi.Tag, False)
  18.  
  19. It works properly.
  20.  
  21. C#:
  22.  
  23. lvi.ImageIndex = SystemImageListManager.GetIconIndex( lvfile.Tag, false);
  24.  
  25.  
  26. It gives error:
  27.  
  28. Error 22 No overload for method 'GetIconIndex' takes '2' arguments

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.