-
November 5th, 2013, 05:13 PM
#1
MFCPropertySheet and MFCToolBar
Is it possible to add a MFCToolBar to the header of a MFCPropertySheet because every page which will be dynamically added during runtime will be using the same toolbar and if it IS possible I would much rather do it this way instead of putting the same toolbar on every page. I have enabled the header with height of 48 and have implemented the MFCToolBar code first in the constructor then in OnCreate. It does not generate any errors during compiling or at runtime however the toolbar does not show.
-
November 5th, 2013, 05:19 PM
#2
Re: MFCPropertySheet and MFCToolBar
Originally Posted by RobNHood
... I have enabled the header with height of 48 and have implemented the MFCToolBar code first in the constructor then in OnCreate. It does not generate any errors during compiling or at runtime however the toolbar does not show.
Could you show your code?
Last edited by VictorN; November 5th, 2013 at 05:21 PM.
Victor Nijegorodov
-
November 5th, 2013, 05:28 PM
#3
Re: MFCPropertySheet and MFCToolBar
IN HEADER
Code:
CMFCToolBar m_wndToolBar;
IN CONSTRUCTOR
Code:
EnablePageHeader(48);
IN OnCreate
Code:
if(!m_wndToolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE,IDR_TOOLBAR )){
TRACE0("Failed to create toolbar\n\n");
return FALSE;
}
m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() & ~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_ANY));
m_wndToolBar.LoadToolBar(IDR_TOOLBAR,0,0,TRUE);
m_wndToolBar.CleanUpLockedImages();
m_wndToolBar.LoadBitmap(IDB_TOOLBAR,0,0,TRUE);
m_wndToolBar.SetOwner(this);
m_wndToolBar.SetRouteCommandsViaFrame(FALSE);
CSize sizeToolBar = m_wndToolBar.CalcFixedLayout(FALSE,TRUE);
m_wndToolBar.SetWindowPos(NULL,10,10,sizeToolBar.cx + 10, sizeToolBar.cy + 10,SWP_NOACTIVATE | SWP_NOZORDER);
-
November 5th, 2013, 10:42 PM
#4
Re: MFCPropertySheet and MFCToolBar
I just went ahead and embedded the CMFCPropertySheet inside a dialog and then created the CMFCToolBar from OnInitDialog and it works fine.
Tags for this Thread
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
|