Jump to content
  • Advertisement
Sign in to follow this  
InsaneBoarder234

Win32 - BS_BITMAP button bitmap disappears when disabled?

This topic is 4841 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using C++/Win32 API to create a window and controls for my program and I'm using buttons with the BS_BITMAP style. After a quick google search I got them working great until I tried disabling the buttons. Now the idea I had in my head was that I would have to set a new disabled button image whenever the buttons are disabled - So basically send the BM_SETIMAGE message again with the disabled button image. But whenever I disable the buttons they turn into ugly grey rectangles, whether or not I send a BM_SETIMAGE message to change the button image. Heres a screenshot to show what I mean. The left-most and right-most buttons are enabled and show their images fine but the middle three buttons are disabled and show an ugly grey rectangle. I've searched google for information on this and all I could find were two forum posts where people had suggested things that didn't work and then the post just died. Surely someone knows how to make a Win32 API button where the disabled image actually works! Cheers! :)

Share this post


Link to post
Share on other sites
Advertisement
Sorry I'm at work and cannot answer the OP question fully at the moment. My recollection is that if want to get bitmap buttons drawn properly when disabled you have to resort to owner drawn buttons but I could be mistaken.

Probably the easiest solution is to make your button images icons with transparency and use BS_ICON instead.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
if you use a toolbar control to display the buttons, the toolbar control will take care of "disabling" the button image for you, or you can provide your own disabled image via an image list.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!