Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Specified argument was out of the range of valid values. Parameter name: '0' is not a valid value for 'index'.

$
0
0

Hi friends,

This is the final hope to clear this error.Due to this error i am unable to see the controls of my project.so i am unable to move to next step. Here i am creating a tree structure which having Desktop,MyComputer etc..11 icons. while tree pop up these icons are adding dynamically. i kept these icons in folder and i assign image index with below code.due to dis icons i am geting fallowing error.

Specified argument was out of the range of valid values. Parameter name: '0' is not a valid value for 'index'.

my code:

foreach

 

(DriveInfo drvinDriveInfo.GetDrives())

{

 

//add logos of the tree

 

if (drv.DriveType ==DriveType.CDRom)

parentNode.Nodes[j++].ImageIndex = 2;

 

elseif (drv.DriveType ==DriveType.Network)

parentNode.Nodes[j++].ImageIndex = 8;

 

elseif (drv.DriveType ==DriveType.Unknown)

parentNode.Nodes[j++].ImageIndex = 9;

 

elseif (drv.DriveType ==DriveType.Removable)

parentNode.Nodes[j++].ImageIndex = 1;

//add rem img index

 

elseif (drv.DriveType ==DriveType.Fixed)

parentNode.Nodes[j++].ImageIndex = 3;

 

elseif (drv.DriveType ==DriveType.Ram)

parentNode.Nodes[j++].ImageIndex = 3;

//add ram img index

}

I am pleased to each and every one..please help me out.

 

thank you in advance..

Srinubabu g.


Viewing all articles
Browse latest Browse all 2535

Trending Articles