I have a CToolbar and within it I have a button with style BTNS_BUTTON|BTNS_DROPDOWN. I would like to make it a split button, so the left side of the button is a button, and the right side has a drop down menu.
To complete this, I create the button then I call ::SendMessage like so:
::SendMessage( hwndForButton, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_DRAWDDARROWS );
This works great and creates the split button, but also has the ill-effect of moving down the toolbar a couple pixels. If I don't send the message, then I still have the issue (and I don't have the split button anymore).
If I change the style of the button to BTNS_BUTTON|BTNS_WHOLEDROPDOWN then I don't have an issue, although I also don't have the split button.
Any clue as to what could be going wrong here? I figure there is a margin that is applied to a BNTS_DROPDOWN and it is causing the toolbar to move down.
Well this question is very old indeed but since it appears at the very top of google results on the topic and for future reference browsing a little further it seems that there is one workaround (quoted from http://www.ureader.com/msg/1484852.aspx):
"Don't know why, but the problem rise when I set the the BTNS_DROPDOWN style from the beginning. I've if add the buttons without any of the set to BTNS_DROPWN and in the next line I use TB_SETBUTTONINFO to change the style, everything works fine."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With