CControlBar in CChildFrame
Posted: 12 Dec 2011, 12:29
Se poate pune un CControlBar intr-un CChildFrame ? Am luat de aici un control derivat din CControlBar si am incercat sa il pun intr-un ChildFrame similar cum se pune intr-un CMainFrame :
... nu merge asa ... apoi am incercat sa pun acest ControlBar in CChildFrame din CView ... cu aceleasi rezultate (atasasez acesta incercare pentru exemplificare).
Code: Select all
// ChildFrm.h
//protected:
CControlBarExt m_wndControlBar;
CTestDialog m_cDialog;
Code: Select all
int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if(CMDIChildWnd::OnCreate(lpCreateStruct) == -1)return -1;
// TODO: Add your specialized creation code here
if(! m_wndControlBar.Create(this, &m_cDialog, CString("ControlBar Demo"), IDD_DIALOG1))
{
TRACE0("Failed to create dialogbar\n");
return -1; // fail to create
}
m_wndControlBar.SetBarStyle(m_wndControlBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
m_wndControlBar.EnableDocking(0);
DockControlBar(&m_wndControlBar);
return 0;
}