Hey everyone, I am working on a win32 project right now and I have a few buttons that I wanted to change how they look so I gave them the BS_OWNERDRAW property and drew them myself. Now sense I am using ownerdraw there is no visual indication of when someoone hovers over the button and/or clicks it. So I want to make the button turn slightly transparent when someone hovers over it. Does anyone know what I should do to achieve this?


4 Years
Discussion Span
Last Post by tinstaafl

Just off the top of my head, I would say to capture the WM_MOUSEMOVE message for the particular buttons and then set the alpha as you wish.


Since you're starting with a standard button and modifying it, you should have access to the MouseEnter event. Put your code to change the button in there. Setting the TransparencyMask of the Bitmap Should help in what you want.

One alternative to the button is the label. By changing the border in the Click event you can give an indication of clicking and the backcolor supports Colors.Transparent.

Edited by tinstaafl

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.