473,654 Members | 3,280 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

treeview and imagelist

Sam
Hi again...
I'm trying to assign icons to the root nodes of my treeview.

I've got an imagelist that contains 6 images.
I've assigned this imagelist to be the one of my treeview.
(I've used the properties manager for the above)

I assign an icon to a node as this:

tvRelations.Nod es(iCntr).Image Index = 0

where iCntr represents the index of my node.
Unfortunately no images is being displayed... What's wrong ?

Thx

Nov 21 '05 #1
1 1612
"Sam" <sa************ **@voila.fr> schrieb:
I'm trying to assign icons to the root nodes of my treeview.

I've got an imagelist that contains 6 images.
I've assigned this imagelist to be the one of my treeview.
(I've used the properties manager for the above)

I assign an icon to a node as this:

tvRelations.Nod es(iCntr).Image Index = 0

where iCntr represents the index of my node.
Unfortunately no images is being displayed... What's wrong ?


If you are calling 'Application.En ableVisualStyle s' in order to enable
Windows XP visual styles for your application, call 'Application.Do Events'
directly after the call to 'EnableVisualSt yles'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

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

Similar topics

4
10367
by: What-a-Tool | last post by:
Is possible to use the windows image list for icon display in my treeview control? Would appreciate it you could point me towards a code sample or Key phrase to use in a google search. Thanks --
1
16848
by: Anthony Boudouvas | last post by:
Hi to all, i have a treeview that i put some nodes in it with their repsective images. If i try to change the image and set it to some other ImageList index, nothing happens. The code i use is: private void ChangeServantStatus(string servant, ServantStatus status) {
3
356
by: frazer | last post by:
hi i have a set of bitmaps in an array. and i want to add it to a imagelist so that i can show those images in my treeview. imageList2.Images.Add (Image.FromHbitmap (picture.Bitmap)); //cant use this gives me an error do i need to convert from bitmap to a memory stream?
3
821
by: feel | last post by:
Goin' crazy with this recursive function ported from delphi... I send a string like DirA/ DirB /DirC but i get in the treeView each one in a new node.Cant get the child node....!! -DirA -DirB -DirC instead of: DirA | - DirB
1
6672
by: paradox | last post by:
I want to have a TreeView that shows an image on some items, but not all. Basically, if a certain condition is true, a caution icon is placed next to the treeview item. The problem is that, by adding a ImageList to the TreeView, the ImageIndex property of the items in the TreeView defaults to 0. I could put a blank icon in the ImageList and make it the 0 index image, however, this makes an ugly space. Would I have to create my own...
3
2582
by: Grant Schenck | last post by:
Hello, I'm going round and round on how to best handle images for a treeview control. These are all known at design time so there is no dynamic aspect. That said, I want to associate the image with my project so I can easily edit them. It seems like I need to do this: - Create one bitmap per image.
1
6507
by: Tom | last post by:
Why in the heck does VB.NET want to set the SelectedImageIndex any time I set the ImageList for my treeview?!? Yes, I want to have images for the nodes, but I don't want an image to be displayed whenever I select a node. I simply want it to simply show the same image that is on the node. And once you set the ImageList, you can set the SelectedImageIndex to None/Nothing!!! I thought I could do it a hokey way by setting the...
1
2251
by: Webster | last post by:
Hello, I created a User Control consisting of a TreeView and an ImageList. I've populated the ImageList with pictures (design-time using the Properties Window), and I've added some Nodes to the TreeView setting certain Nodes to different graphics from the ImageList (once again at design-time). The problem is, when I add the User Control to my main form (of a seperate project), the icons of the TreeView displayed on the control all...
0
1398
by: Sarika | last post by:
Hi, 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
1
2899
by: Jeffrey Walton | last post by:
Hi All, I have an array of 16x16 bitmaps (60 total). I've tried adding the array to the ImageList with the Add method, but the TreeView paints as if no BMP is present. The problem is the method does not 'break out' the bitmaps. If I specify Index 0, I get an unexpected result (horizontal compressing of the file).
0
8376
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
8815
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...
0
8594
tracyyun
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...
0
7307
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
6161
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
5622
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
4149
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...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2716
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

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.