【发布时间】:2014-12-13 15:32:45
【问题描述】:
我想将 CMDIChildWnd 设为可停靠...。我创建窗口框架的代码单击功能区按钮并希望以选项卡式格式停靠所有窗口,当我放置“拖动我的框架”时显示停靠管理器格式 [DT_SMART]。 ..
此代码是Button Click事件创建多个Frame....
pDocTemplate_New1 = new CMultiDocTemplate ( IDR_RiboonCFormViewTYPE,
RUNTIME_CLASS(CRiboonCFormViewTestDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CDepartement));
AfxGetApp () -> AddDocTemplate (pDocTemplate_New1);
// Create a new child window
CMDIChildWnd * pMDIActive = MDIGetActive (); // get the pointer of the currently active child window
//CDocument * pDoc = (CDocument *) pMDIActive-> GetActiveDocument (); // get the document pointer
CMDIChildWnd * pNewFrame = (CMDIChildWnd *) (pDocTemplate_New1 -> CreateNewFrame (NULL, NULL));
pNewFrame->EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
// Create a new frame window
if (pNewFrame == NULL)
{
AfxMessageBox("new window can not be established ", MB_OK, 0);
}
pDocTemplate_New1 -> InitialUpdateFrame (pNewFrame, NULL); // display window
MDITile (MDITILE_HORIZONTAL); // tile multiple windows
【问题讨论】:
标签: c++ visual-c++ mfc