Re: ArgumentOutofRangeException in ListView

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Imran Koradia (nospam_at_microsoft.com)
Date: 10/12/04


Date: Tue, 12 Oct 2004 09:54:06 -0400


> With a little reworking of the code, I was able to get this to compile;
I guess you figured I'm VB'er - I gave my best shot at getting the syntax
right for C# but looks like I still messed up ;-)

> however; I'm still getting the same exception at the same place.

I'm not sure why you would still get the error. I used the same code and its
working fine. To make sure, I even created a new C# project and tried out
the code you posted with a simple listview. That worked fine too. I also
tried various views - Details, LargeIcon, etc etc.. For all of them, the
piece of code worked fine. I believe its something else thats causing the
exception to be thrown. I suggest you put a break point the Remove statement
and debug it step by step to see where exactly the exception is being
thrown. That seems to be the only way you can figure out what's going wrong.

hope that helps..
Imran.



Relevant Pages

  • Re: How to debug this?
    ... >> When you compile a program in 'debug' configuration these 'symbols' are ... >> allow for richer information to be displayed when an exception occurs. ... >> is thrown ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Constructors And Exceptions
    ... > is thrown ... The type of s_ is like char**, so your could should not compile. ...
    (comp.lang.cpp)
  • Re: Delphi 7 vs Delphi 2005
    ... > The problem is it dies during the compile and no exception is thrown. ... I suggest removing sections of code until it compiles OK, ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: is catch and re-throw a good idea?
    ... >>catching a Throwable doesn't stop the exception from being a MyException ... > The below code doesn't compile because ... declared to be thrown ...
    (comp.lang.java.programmer)
  • Re: Validating file names
    ... running Novel, from your G: running Linux file system, from your H: running ... I am not saying one does not exist! ... file file and handle any exceptions that were thrown. ... If an exception is thrown then the specified ...
    (microsoft.public.dotnet.languages.vb)