Hi,
I have been testing a form with a tree control with a couple of 100 nodes. Each node has a single image.
I was using an imagelist with mainly .ico files in that imagelist. I was using LeftImages.Add.
I changed all the code to be Override.NodeAppeareance.Image = resourceSomePicture.pngName.
Now:
1) The form takes a very long time to load
2) if i close and open the form a few times i get out of memory errors.
What is the right way to do this? ImageLIst? Resource File? LeftImages? NodeAppearance?
Why the memory errors? Do I need to do something special on the dispose event of the form?
Thanks,
Mel
Hello Mel,
I believe that this is happening because you are creating 100 other appearance objects. Is it ok when you are using LeftImages.Add()?
Well now I am adding the images via LeftImages.Add and an image list but still get out of memory (specifically on lines that add the image) when i clear and recreate the tree.
What is the right way to do this and do I need to do anything other than Nodes.Clear()?
Thanks,Mel
Could you please try to attach if possible a small sample project reproducing the above mentioned issue since I am not able to do so, I will be happy to take a look at it.
I am checking about the progress of this issue. Please let me know If you need any further assistance on this.
I have been testing this and so far using the left.images add with an imagelist has been most effecient. What Mike said makes a lot of sense and has me re-thinking how to handle the settings for controls throughout the application. All of our combo boxes for instance look and behave the same. I notice that in the code behind if i manually make a change to that control it creates a sepearate appearance object for each setting. If i create a global appearance for the form or even the project I can just set it to that control.
Thanks for the help.