Link to home
Start Free TrialLog in
Avatar of Peter Kiers
Peter KiersFlag for Netherlands

asked on

Treenode is not showing the right imageindex

Hi,

I have this methode, and even thou I have specified
the right imageindex picture. It is not working:


            string NewText = "";
            if (InputBox.Show("New Folder", "Folder Name", ref NewText, validation) == DialogResult.OK)
            {
                TreeNode n2 = tvNotes.SelectedNode;
                n2.Nodes.Add(NewText);
                n2.ImageIndex = 2;               <==========
                n2.SelectedImageIndex = 3;  <==========

            }

Does anyone know the answer to that and is willing to help me?

Peter
SOLUTION
Avatar of mkobrin
mkobrin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Miguel Oz
Avatar of Peter Kiers

ASKER

"Firstly the imagelist is 0 based so setting the imageindex to 2 will display the 3rd image, and 3 will show the 4th image."   (I know)

"Secondly, have you addigned the correct imagelist to your treeview?" (Yes i did)

P.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ahhh,perfect.