Re: Why am I getting out of range exception with these code?
- From: "Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx>
- Date: Sat, 4 Nov 2006 13:34:12 +0100
Pucca,
To get an System.ArgumentOutOfRangeException with treeviews and things like
that is an often showed problem in these newsgroups.
It comes mostly because when you add a node you start a recursive loop if
there is an event that catches that. Have a look if you have somewhere an
event that start if there is something added to your treeview.
For that I don't need to see code, it can be on some strange places you
know.
I hope this helps,
Cor
"Pucca" <Pucca@xxxxxxxxxxxxxxxxxxxxxxxxx> schreef in bericht
news:A89D9F12-E62C-4FD2-A4A1-BA01D53C90F6@xxxxxxxxxxxxxxxx
Hi: Below is the error I got from the 2 lines of code below. I don't
understand why and how to correct it. The actionMenu.DropDownItems has 0
item in its collection at the time of the code. Thanks.
An unhandled exception of type 'System.ArgumentOutOfRangeException'
occurred
in mscorlib.dll
Additional information: Index was out of range. Must be non-negative and
less than the size of the collection.
ToolStripItemCollection contextsMenuItems =
contextsMenuStrip.Items;
.AddRange(contextsMenuItems);
--
Thanks.
.
- Prev by Date: Re: Connection to SQL database on local computer
- Next by Date: Re: memory leak or not?
- Previous by thread: Re: Why am I getting out of range exception with these code?
- Next by thread: Isolated Storage, XML File Upload
- Index(es):