Posted By

umeshT20 on 05/24/08


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

umang_nine
danfinrud55


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


 / Published in: C#
 

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#.

  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  

You need to login to post a comment.