I use CToolBarCtrl::HideButton to hide or reveal a button on a toolbar. I cannot seem to make the toolbar resize itself to fit the buttons that are actually visible on the toolbar after the hide/reveal function. I have tried:
CToolBar::Invalidate
CToolBarCtrl::Invalidate
CToolBarCtrl::AutoSize
CToolBar::SetHeight

Example Befoe Hide:


Example After Hide:


Example After left-click on toolbar:


How can I get it to resize (like third example)???