programmer1024
Member
- Joined
- Jun 18, 2006
- Messages
- 23
- Programming Experience
- 3-5
I am trying to use a treeview and imagelist.
I added 3 images to the imagelist.
I have set the treeview's imagelist property to the imagelist I added to the form.
Here is some sample code for when I programmatically add nodes to the treeview.
nd = TreeView1.TopNode.Nodes.Add("", reader.ReadString, 0)
Then I tried:
nd.SelectedImageIndex = 0
I keep getting the following error, and it never points to the offending line of code.
"An error occurred creating the form. See Exception.InnerException for details. The error is: Index was outside the bounds of the array."
I added 3 images to the imagelist.
I have set the treeview's imagelist property to the imagelist I added to the form.
Here is some sample code for when I programmatically add nodes to the treeview.
nd = TreeView1.TopNode.Nodes.Add("", reader.ReadString, 0)
Then I tried:
nd.SelectedImageIndex = 0
I keep getting the following error, and it never points to the offending line of code.
"An error occurred creating the form. See Exception.InnerException for details. The error is: Index was outside the bounds of the array."