472,110 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,110 software developers and data experts.

Winforms treeview bug

Nodes display as whitespace when scrollable is set to false, and more
nodes are cleared and recreated than will fit into the space available.

Steps to replicate:

Create a form, with a button and a treeview that can display less than
12 Nodes at once . Put this code in button.Click

treeView1.Nodes.Clear();
treeView1.Nodes.Add(new TreeNode("Test1"));
treeView1.Nodes.Add(new TreeNode("Test2"));
treeView1.Nodes.Add(new TreeNode("Test3"));
treeView1.Nodes.Add(new TreeNode("Test4"));
treeView1.Nodes.Add(new TreeNode("Test5"));
treeView1.Nodes.Add(new TreeNode("Test6"));
treeView1.Nodes.Add(new TreeNode("Test7"));
treeView1.Nodes.Add(new TreeNode("Test8"));
treeView1.Nodes.Add(new TreeNode("Test9"));
treeView1.Nodes.Add(new TreeNode("Test10"));
treeView1.Nodes.Add(new TreeNode("Test11"));
treeView1.Nodes.Add(new TreeNode("Test12"));

Click the button _twice_. You'll see that everything looks fine.

Now change Scrollable to false on the TreeView and repeat the
experiment.

The TreeView looks blank. But if you click on it, (on the far left)
you'll discover there are entries there - they're just blank. In fact,
adding a handler for treeView1.AfterSelect with
Console.WriteLine(e.Node.Text);
in it, shows that the treenodes are there, and have text - they just
display as whitespace

Anyone else replicate this?

Andy D

Nov 25 '05 #1
0 1345

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by John Spiegel | last post: by
reply views Thread by Corky Whiteboard | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.