开发者

How to set toolbar button height?

开发者 https://www.devze.com 2022-12-15 01:54 出处:网络
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

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消