Just create a blank icon and stick it in your image list.
--
Robbe Morris - 2004-2006 Microsoft MVP C#
I've mapped the database to .NET class properties and methods to
implement an multi-layered object oriented environment for your
data access layer. Thus, you should rarely ever have to type the words
SqlCommand, SqlDataAdapter, or SqlConnection again.
http://www.eggheadcafe.com/articles/..._generator.asp
"WhiteWizard" <WhiteWizard@discussions.microsoft.comwrote in message
news:E62473B6-F995-4DC8-94B8-583035107EDC@microsoft.com...
Quote:
Anyone out there today? Happy Thanksgiving!
>
I am writing a Window app that has a TreeView control. I am creating the
nodes dynamically from an XML file, and I have some icon images that I
have
associated with each of the "top" nodes. The users, after some usability
testing, have decided they don't want the "child" nodes to have any icons
associated.
>
I cannot seem to get the child nodes to NOT have an icon. I have tried
changing the index of the ImageControl the nodes are pointing to to a -1,
commenting out the assignment, etc. but they end up using the image at
index
0. Here's the relevent code:
>
//...switch statement above this to figure out which icon index to put in
currentIcon
tempSysNode.ImageIndex = currentIcon;
sysTree.Nodes.Add(tempSysNode);
node = tempSysNode;
categoryIdentifier = tempSysInfo.systemName;
}
>
// Add SubSystem nodes to the TreeView, under their respective System name
>
currentIcon = -1; //One of the many tests
TreeNode tempSubsysNode = new TreeNode(tempSysInfo.subsystemName);
tempSubsysNode.Tag = tempSysInfo.ID;
//tempSubsysNode.ImageIndex = currentIcon; //I'VE TRIED COMMENTING THIS
OUT
BUT IT DEFAULTS TO INDEX 0 WHEN I DO
node.Nodes.Add(tempSubsysNode);
DataRow newRow = systemsDataSet.Tables[0].NewRow();
>
//More code to figure out if there are any grandchild nodes
>
How do I eliminate the icons for all of the child, grandchild, etc. nodes?
>
WhiteWizard
aka Gandalf
MCSD.NET, MCAD, MCT