-
November 13th, 2008, 03:01 PM
#1
ToolBar WON'T Re-size
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)???
-
November 13th, 2008, 04:16 PM
#2
Re: ToolBar WON'T Re-size
Tried calling CToolBarCtrl::AutoSize after the HideButton ?
-
November 13th, 2008, 05:41 PM
#3
Re: ToolBar WON'T Re-size
Thanks for the suggestion, but in my original post I said that I had already tried these functions:
CToolBar::Invalidate
CToolBarCtrl::Invalidate
CToolBarCtrl::AutoSize
CToolBar::SetHeight
In fact I got the idea to try CToolBarCtrl::AutoSize from another post you made on this forum... Unfortunately, it doesn't seem to work for me...
-
November 13th, 2008, 06:08 PM
#4
Re: ToolBar WON'T Re-size
Sorry. Didn't notice that.
This code should do it..
Code:
m_wndToolBar.GetToolBarCtrl().HideButton(ID_FILE_OPEN);
m_wndToolBar.GetToolBarCtrl().GetParentFrame()->RecalcLayout();
Last edited by kirants; November 13th, 2008 at 06:25 PM.
-
November 13th, 2008, 10:31 PM
#5
Re: ToolBar WON'T Re-size
THANKS kirants!!! That did it!
Now if I can just figure out how to mark the thread as "Resolved"...
VictorN Suggested I do this, but for some reason I don't have the fifth item in the Thread Tools menu...
This is what it looks like for me...
Any thoughts on how I can get at the "Mark Thread as Resolved" feature???
-
November 13th, 2008, 11:40 PM
#6
Re: ToolBar WON'T Re-size
Cool ! Isn't it amazing sometimes the solutions can be so simple and sweet !
As for the resolved thing, it seems to have disappeared for me too. Recently the forum s/w got upgraded. Wondering if this disappearance has something to do with it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|