471,354 Members | 1,142 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

TreeView.TreeNode.Image.Refresh();

VS .NET 2003, Googling, msdn searching not successful.

I'm using the images of nodes of a TreeView to show the Pass/Fail results of
several tests. The tests are a little slow so I would like to Refresh()
between each test. This works:

MyTreeView.Refresh();

.... but it causes a lot of flicker. The node text does not change. Only
the TreeNode.ImageIndex changes.

Is there a way to refresh just the image portion of a TreeNode?

Thanks.

-- Mark
Dec 7 '05 #1
2 12778
Mark,
Is there a way to refresh just the image portion of a TreeNode?


You can try something like

MyTreeView.Invalidate(someNode.Bounds);
MyTreeView.Update();

Unlike Refresh this will only invalidate and redraw that one node's
area. You can shrink the rectangle returned by Bounds to only cover
the image if you can figure out where exactly the image is located.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Dec 7 '05 #2
Mattias -- Excellent! Thanks!

-- Mark

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:ey****************@TK2MSFTNGP12.phx.gbl...
Mark,
Is there a way to refresh just the image portion of a TreeNode?


You can try something like

MyTreeView.Invalidate(someNode.Bounds);
MyTreeView.Update();

Unlike Refresh this will only invalidate and redraw that one node's
area. You can shrink the rectangle returned by Bounds to only cover
the image if you can figure out where exactly the image is located.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Dec 9 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Jeroen Ceuppens | last post: by
1 post views Thread by Marco Maroni | last post: by
3 posts views Thread by Paul Johnson | last post: by
5 posts views Thread by Bob | last post: by
1 post views Thread by Lukas Kurka | last post: by
reply views Thread by Tom | last post: by
reply views Thread by XIAOLAOHU | 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.