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.
Re: MFCPropertySheet and MFCToolBar
Quote:
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?
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);
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.