Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
.net treeview
Message
From
20/02/2004 06:41:39
 
 
To
19/02/2004 11:32:07
General information
Forum:
ASP.NET
Category:
Other
Title:
Miscellaneous
Thread ID:
00878760
Message ID:
00879118
Views:
16
Sergio,

You can do this by controlling what bitmap goes with what node when you build the Nodes collection.
this.treeView1.ShowLines = false;
this.treeView1.ShowPlusMinus = false;
this.treeView1.ShowRootLines = false;

// Set the mask colour if you use one.
imageList1.TransparentColor = System.Drawing.Color.FromArgb(255, 0, 255);

treeView1.ImageList = imageList1;

// Set the treeview's default image index values to an value
// that is out of range.
treeView1.ImageIndex = 1;
treeView1.SelectedImageIndex = 1;

TreeNode newNode1 = new TreeNode("Parent Node 1");

newNode1.ImageIndex = 0;
newNode1.SelectedImageIndex = 0;
newNode1.Expand();

treeView1.Nodes.Add(newNode1);

TreeNode newChildNode = new TreeNode("Child Node 1");

newNode1.Nodes.Add(newChildNode);

TreeNode newNode2 = new TreeNode("Parent Node 2");
newNode2.Expand();
treeView1.Nodes.Add(newNode2);
As you can see its just a matter of getting the bitmaps in the right place.

Regards
Neil
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform