المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to select right size icon from imagelist with multiple resolution icons



C# Programming
08-21-2009, 07:06 PM
Hello Everyone-

I have an imagelist that I have added .ico files into. The icons have multiple resolutions. I am trying to use one imagelist for multiple roles in my application. I set the default size to be 32,32. The places in the application where I set the image of the picturebox or a large button to an image in the imagelist, it works fine. But there are times when I want to only use a 16,16 icon, say in the treeview. When I set the icon of the node to the image in the imagelist, it is using the default size which is 32,32. I've tried setting the size on the fly of the imagelist, such as imageListStatus = new Size(16,16), but that appears to delete all of the images out of the list.

Is there any way to use multiple resolutions out of an imagelist that is containing icons with many sizes?

TIA!