473,739 Members | 5,405 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TreeNode Image

Tom
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
3. aftercollapse

The AfterExpand and AfterCollapse events set the imageindex appropriately,
and seems to be working fine. However, here's my prob:

If I expand a folder, and then click a subdirectory under that folder, and
then go back and click on the parent folder (which is still expanded) the
folder icon reverts back to the closed folder icon, when it should still be
the open folder icon.

I know the afterexpand and aftercollapse events do not get fired.
AfterSelect of course gets fired, but after stepping through the code, the
TreeNode has the appropriate image index (1) at the beginning and end of the
function right before it returns.

My TreeNode's are not exactly TreeNode's of the TreeNode class. I created
my own class that derives from TreeNode and has an ArrayList inside of it.
I can't imagine that the inheritance is screwing this up somehow, but that's
my guess at this point.

Can anybody see something that I'm doing wrong?

Thanks.

Aug 26 '08 #1
0 1541

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2515
by: SeanT | last post by:
Greetings and salutations! I am having a real issue with the VB.NET TreeView control. I need to display an image (a.k.a. logo, picture, etc) from a file as the treenode object. I can not seem to find a way to do this in .NET. I have tried the DrawImageUnscaled and thought that was the way to go, but I was wrong. If anyone has any suggestions, please help! The code I have currently follows: Public Sub mTreeViewLoad(ByVal m_xmld As...
5
1709
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 imagelist and calls a subroutine that assigns an image to each node depending on its type. If I expand a classA node, all is well. ie. I see the classA image on the classA node and the classB image on the exposed classB node (which is always
3
2059
by: Matthew Woods | last post by:
Hi, does anyone know how to select a treenode with the first click? the first click on a treeview will highlight the node under the mouse when it was clicked BUT that node isn't actually selected until you click on it again - very annoying property. i know i have to handle an event to set the selected node to be the highlighted node but i have no idea how. Thanks for any help, Matt
2
13016
by: Mark Jerde | last post by:
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.
1
1500
by: Andrea | last post by:
Hi, Im using an ASP.NET 2.0 TreeView control on a web page with an Xml MapSiteMenu. Some nodes does'nt have url property (just acts as container of other children nodes). My question is: Can i open and close a treenode without clicking on +/- image (but just clicking on the treenode caption (title property) ? Thanks, Andrea.
11
7429
by: Alan T | last post by:
I am using VS 2005 and just wonder why I don't have this method?
1
2453
by: Lukas Kurka | last post by:
Hi, Is there a way how to add Controls into TreeNode? Thank You Lukas
3
11514
by: WhiteWizard | last post by:
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...
1
3274
by: AAaron123 | last post by:
If you see this posted twice - sorry. My news reader showed my first post as "No Longer Available" I have the following in a .css file. The treeNodes behave as if they were "a" elements. I can't get them to not respond to the mouse!
0
8969
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9479
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9266
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8215
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6754
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6054
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3280
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.