ImageList icons show up with black backgroundAfter trying to get the ImageList control to take icons with transparent backgrounds for several hours, we've decided that the ImageList control must have a bug. It seems that when the ImageList is loaded dynamically at runtime, it works fine, but if you load it with icons at design-time the icons end up with a black background after running the project multiple times. The only method of fixing this problem that we could find was to either load the icons at runtime from files on the system (which is not a great solution), or to create picture controls containing the icons you wish to use in your ImageList and then loading the ImageList at runtime using the pictures from the PictureBox controls. Depending on what you are using the images for, you may also be able to add the icons to a resource file and then fill the ImageList at runtime using the LoadResPicture function. There is however a bug in the LoadResPicture function which causes the size of the icon to sometimes change to 32x32, but depending on what you're using it for, this may not affect you. If you have any solutions to add to this problem, please post them using the comment system below. Author: DPAK Created: May 7 2006 Categories: Visual Basic TechByte #139 Warning: By visiting this site and/or by using any information contained herein, you agree to the Techbytes.ca terms of use. Add a comment about this TechByteIf you wish to add a comment regarding this TechByte, please use the form below. Please note that by submitting comments using this form you are allowing all of the information submitted to be visible on this website. Any comments submitted using this form will only be shown on the website if they are approved by the administrators of this site. IF APPROVED, COMMENTS MAY TAKE SEVERAL DAYS TO BE POSTED. Other TechBytes: |
|

