Peter Kiers
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
"Secondly, have you addigned the correct imagelist to your treeview?" (Yes i did)
P.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ahhh,perfect.
Check:
http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.imagelist.aspx