473,399 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 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 12953
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jeroen Ceuppens | last post by:
Hi, I want to make something that adds a TreeNode to the end of TreeView, that TreeView Looks like + Level 1 + Level 2 + Level 3 - Level last
1
by: Marco Maroni | last post by:
How to force image refresh on client browser ? Is ti possible to force the refresh of the same image (tha was changed server-side) to the client, without user press Contrl+F5 in IE ? - Marco
3
by: Paul Johnson | last post by:
I have a web site that allows users to upload images. The problem is when an image is uploaded over the top of another image the user would have to press F5 to refresh the images and clear the...
5
by: Bob | last post by:
Hi, I have a treeview which contains nodes of a class (classA) derived from treenode. These classA nodes may contain nodes of a class (ClassB) derived from classA. The form load populates a...
0
by: David | last post by:
Hi, I've been working with TreeView for ASP.NET. I've had several puzzling difficulties with it. For example I can write an application that works fine programmatically adding TreeNode objects to...
0
by: Jared | last post by:
I am using a TreeView with data stored in a database and have been trying to store a node index over a postback and re-select the node without using javascript. I couldn't find anything in these...
1
by: Lukas Kurka | last post by:
Hi, Is there a way how to add Controls into TreeNode? Thank You Lukas
4
by: jmDesktop | last post by:
I have searched everywhere and tried several things. I have a treeview with and want to be able to only select a parent node. For example: root //don't want to drag this -parent1 //yes, drag...
0
by: Tom | last post by:
I have your classic WinForm treeview that uses an image list with 2 images: 1. An open folder. 2. A closed folder. The events that I have registered for are: 1. afterselect 2. afterexpand...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.