By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,018 Members | 885 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,018 IT Pros & Developers. It's quick & easy.

Alpha blending with Toolbar and Disabling buttons makes button dark gray

P: n/a

I am using the .NET toolbar with VB.NET 2003.
My toolbar uses icons images that are actually PNG files and uses alpha
blending on it. So to make alpha blending work correctly with the Toolbar
and the Imagelist I had to use a tricky method with API calls that is
described like this by a MS MVP :

1) Use v6 of the common controls (have a manifest)
2) Load the PNG using GDI+
3) Create a 32bpp DIBSection (interop with Win32 GDI)
4) LockBitmap() on your GDI+ Bitmap
5) memcpy() the image bits to the 32bpp DIBSection
6) Use ImageList_Add() (Win32) to add the DIBsection to the ImageList

Using the method, the icons with alpha blending appears great on the
toolbar. The problem now is when is set Toolbar1.Buttons(0).Enabled = False,
instead graying out the image as if it was disabled, the buttons becomes
completely dark gray.

I tried to set Imagelist.TransparentColor = Color.Transparent, but it didn't
By the way my Imagelist.ColorDepth is 32 bits

Philippe Meunier
CHCA Computer Systems Inc.
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.