How to make drop down part of toolbar button more wider?
-
I have a CToolBar that uses the TBSTYLE_EX_MIXEDBUTTONS|TBSTYLE_EX_DRAWDDARROWS style, and some toolbar buttons use the BTNS_DROPDOWN style and some of them use BTNS_WHOLEDROPDOWN style. I'd like to make the arrows on the right side of the buttons little bigger and the drop down part more wider, like the Google has done with their toolbar buttons. I have tried to custom draw the drop down part of the buttons in CDDS_ITEMPOSTPAINT, but here I don't get the button style and even the rect is smaller than actual button size for BTNS_WHOLEDROPDOWN styled buttons. I am using pure ATL code(***NO MFC***). Regards! Padmanabh Sharma
-
I have a CToolBar that uses the TBSTYLE_EX_MIXEDBUTTONS|TBSTYLE_EX_DRAWDDARROWS style, and some toolbar buttons use the BTNS_DROPDOWN style and some of them use BTNS_WHOLEDROPDOWN style. I'd like to make the arrows on the right side of the buttons little bigger and the drop down part more wider, like the Google has done with their toolbar buttons. I have tried to custom draw the drop down part of the buttons in CDDS_ITEMPOSTPAINT, but here I don't get the button style and even the rect is smaller than actual button size for BTNS_WHOLEDROPDOWN styled buttons. I am using pure ATL code(***NO MFC***). Regards! Padmanabh Sharma
I think you can try to set another toolbar on top of your current specific toolbar button. That new toolbar should have only one button in it, a wide one. Just like you can put regular controls instead of toolbar buttons, I believe you can also set a toolbar on one of the buttons. First you need to set the style of that button to
TBSTYLE_SEP
, then set the new toolbar on top of it, and set the button's width yourself, handle theOnSize
handler, ... something like that...;)this is this.