When adding buttons to a toolbar (using the old Windows API开发者_如何学编程) I can't seem to find a way to change the height of a button. I need to be able to increase the button's height because I'm using large icons.
I'm currently painting everything myself using custom draw because I wanted to be able to have icons with different widths which is not possible when using image lists. However, in order to get the height ok I'd be willing to drop that requirement and use image lists instead of custom draw.
Have you tried the TB_SETBUTTONSIZE message?
// hWndToolbar is a handle to the toolbar window.
int width = 32, height = 32;
SendMessage(hWndToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(width, height);
精彩评论