tags:

views:

16

answers:

1

I have an MFC CToolBar (dockable to a CFrameWnd) containing a checkbox and a button.

This works fine now, but I need to remove the button, and then the CToolBar does not show properly any more. As it seems because it gets "zero" height. The checkbox style is "turned into" a TBBS_SEPARATOR using a call to CToolBar::SetButtonInfo before it is "created".

How can I make the toolbar visible also wihtout that dummy button?

A: 

I solved this by overriding the CToolBar::CalcDynamicLayout method and provided the size of the toolbar there. Then the button was not needed any more. This assumes the toolbar is created with CBRS_SIZE_DYNAMIC.

bjolan