Problem with TreeView Node Images

Viper

Member
Joined
Aug 27, 2004
Messages
17
Location
South Africa
Programming Experience
5-10
Hi

I have a weird problem.
On the main screen of my application, I have a treeview that, depending on the type of item, one of three images are displayed. Images are 24x24.
When the form is constructed, the image list is initialized:
VB.NET:
imlData.Images.Add("Package", My.Resources.ico_Package24.ToBitmap)
imlData.Images.Add("Task", My.Resources.ico_Task24.ToBitmap)
imlData.Images.Add("Profile", My.Resources.ico_Profile24.ToBitmap)
tvwData.ImageList = imlData

To create an item, I use code like this:
VB.NET:
Dim node as New TreeNode("Test")
node.ImageKey = "Package"
tvwData.Nodes.Add(node)

Ok, now for the weird problem. Sometimes the images display and sometimes there is just a whitespace of 24x24 where the image is supposed to be.
This happens when running from the IDE and running the compiled exe.
I have another control on the same form that initializes a 16x16 image list the same way and that one always works. The other control however, is not a treeview.

Any ideas?
 
Last edited by a moderator:
Can you post a simple sample app that produces the problem?
 
I tried creating a small app but can't replicate the problem.
I'm using some custom controls from ICreate and Krypton and I placed some of those controls in the test application as well and still can't recreate the problem.

The original app is too complicated to post here as you will need the correct database, server components and service to be running just to be able to run the program successfully as it is part of a much larger application.

I've removed the custom controls again and attached the project anyway to give you an idea on whats happening.
 

Attachments

  • WindowsApplication2.zip
    26.2 KB · Views: 18
Last edited by a moderator:
Back
Top