Sign in to follow this  
Kryptus

How do I put custom bitmaps on my toolbar buttons?

Recommended Posts

I put custom bitmaps on my toolbar buttons? I have created a standard toolbar with a few buttons using Win32 API. I can use the standard images such as STD_FILENEW but how do I use a custom bitmap? I tried replacing STD_FILENEW with MAKEINTRESOURCE(IDB_MAIN) but it only displayed a blank button!

Share this post


Link to post
Share on other sites
There's three other methods:
1) Send the toolbar a TB_ADDBITMAP message (check MSDN for details) and then use the index returned in the TBBUTTON structure passed in the TB_ADDBUTTONS message.
2) Create an Imagelist and send TB_SETIMAGELIST to assign the list to the toolbar then use the bitmap index in the TBBUTTON as above.
3) Use CreateToolbarEx. This is an obsolete function but still works as far as I know.

Skizz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this