[英]How to Make CMDIChildWnd as Dockable in MFC?
I want to Make CMDIChildWnd as Dockable.... My Code which Create Window Frame While click on ribbon Button and I want Docking all window in tabbed format, when i place Drag My Frame is show Docking Manager Format[DT_SMART]... 我想将CMDIChildWnd设置为可停靠的...。创建窗框的代码在单击功能区按钮时,我希望将所有窗口停靠在选项卡格式中,当我放置“拖动我的框”时,显示停靠管理器格式[DT_SMART] ...
This Code is Button Click event create multiple 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
CMDIFrameWndEx
. CMDIFrameWndEx
派生。 CMainFrame
CMainFrame
添加该窗格成员 CBRS_FLOAT_MULTI
make the dockable pane float as a unit when attached to a tab. CBRS_FLOAT_MULTI
使可停靠窗格在附着到选项卡时作为一个单元浮动。 An alignment style like CBRS_LEFT
gives the pane the initial alignment. CBRS_LEFT
的对齐样式为窗格提供了初始对齐。 AttachToTabWnd
() to add your pane AttachToTabWnd
()添加窗格
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.