473,849 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image associated with a TreeView Node


I am a little confused about associating an image w/ the VB.NET TreeView
Control. My specific requirement is that I want to associate an image w/ some
specific nodes in the TreeView only.

I coded a test project with a form with a TreeView and an ImageList control.

Me.TreeView = Me.ImageList

'The above statement associates the image at the 0th index of the ImageList
w/ all the nodes of the treeview.

The only way I was able to turn off an image for a particular node is by
Node.ImageIndex = <Some invalid index of the imagelist>

If the treeview has a lot of nodes, this would be a painful thing to do.

Have I misunderstood something?? How can I associate an Image w/ say just
1node in the treeview?

Looking forward to your responses!

Nov 21 '05 #1
0 1402

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

Similar topics

by: CoreyMas | last post by:
Hello everyone, I have downloaded and installed the IE Web controls for Microsoft and I am using the Treeview control to display a simply hierarchy However, I cannot seem to get the Image associated with the node to align vertically (top) to the actual contents of the node. Example
by: gremlin321 | last post by:
i have a very odd behaving treeview. i use image list with a bunch of icons and as nodes get added to a tree i assign image index to each node. everething works fine, no problems there. now, when i click on any node it's icon changes to icon with index 0 in image list, and as i move to another node the original image comes back. i have no events handling in code, so this is a mistery.
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...
by: L.M | last post by:
Hello, I knew how to use the treeview under VB6. After migrating to .NET, well, I'm lost. I try to add a new node, either to the same level or as a child to a selected node in the treeview. However, either it only add it to the root level or it only add it on level below, doesn't matter what I select. And in some case, I just get an exception.
by: Han Sen | last post by:
I'm building a treeview from an xml file. The node values point to various paths, some of which are network paths. Next to every node I'd like to display an "offline" image (if that the path is not accessible). I'd like to do this either before or after the user selects that particular node. How do I check for a path's status? Also I've played around with the AfterSelect event combined with
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
by: ShadowFil | last post by:
Hello, In a MDI application, I want a child form which contains a treeview with a associated form for each node. If I create a child form, I only can put controls. So I can puta Treeview control and a user control which represents the form for one node. So I have the same count of user control than the count of nodes in the treeview. But I will prefer to have forms, and not user control which play the role of
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the form. I only want to allow single selection, so using checkboxes is out of the question. It works as is, but it makes the form very cumbersome if every time that a user selects a node, the whole page has to reload. Is there a way to have a node...
by: hchintapalli | last post by:
Hi, How can I make root node of a TreeView control to have different expanded and collapsed images from the rest of the tree? If I use "ExpandImageUrl" and "CollapseImageUrl" it applies to all nodes including the root. And if I use "RootNodeStyle-ImageUrl" the image stays the same even if expand or collapse the root node. Appreciate your help. Thanks, Harish.
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...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
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...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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...
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();...
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...
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.