|
-
May 8th, 1999, 03:38 PM
#1
hiding toolbars
How can you enable the hiding and reappearance of additional toolbars.
-
May 8th, 1999, 05:09 PM
#2
Re: hiding toolbars
Hi,
1) Create some resources on your menu to show and hide the tool bar (or context menu or whatever you want)
2) In your mainframe class, handle the command to show/hide the toolbar (for example, I handle OnViewHideToolbar1 in response to the user checking, or unchecking a menu item under the View menu).
The handler should look like this:
void CMainFrame::OnViewHideToolbar1()
{
// first check it visible state (hidden or visible)
BOOL bVisible = ((m_wndToolBar1.GetStyle() & WS_VISIBLE) != 0);
// then toggle
ShowControlBar(&m_wndToolBar1, !bVisible, NULL);
RecalcLayout();
}
// then manage the update handler
void CMainFrame::OnUpdateViewHideToolbar1(CCmdUI* pCmdUI)
{
BOOL bVisible = ((m_wndToolBar1.GetStyle() & WS_VISIBLE) != 0);
pCmdUI->SetCheck(bVisible); // depending on your menu's wording...
}
I got this from somewhere. Maybe the VC++ docs, maybe the net... not sure.
HTH,
Harvey Hawes
Software Engineer
BioScience Analysis Software Ltd.
Masters Candidate
Cardiovascular/Respiratory Sciences
Faculty of Medicine
University of Calgary
Calgary, Alberta, Canada
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
|