如:
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
EnableDocking(CBRS_ALIGN_ANY);
m_pTabel = new CTabbedPane;
m_pTabel->m_StyleTabWnd = CMFCTabCtrl::STYLE_3D_VS2005;
m_pTabel->m_bTabsAlwaysTop = TRUE;
if (!m_pTabel->Create (_T(""), this, CRect (0, 0, 200, 200),TRUE, (UINT) -1, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI)) return FALSE;
if(!m_mywnd1.Create("窗口 1", this, FALSE, IDD_DIALOG1, WS_CHILD | WS_VISIBLE ,301)) return FALSE;
m_pTabel->AddTab(&m_d1);
if(!m_mywnd2.Create("窗口 2", this, FALSE, IDD_DIALOG1, WS_CHILD | WS_VISIBLE,302)) return FALSE;
m_pTabe->AddTab(&m_d2);
m_pTabel->EnableTabAutoColor();
m_pTabel->EnableDocking(CBRS_ALIGN_ANY);
DockPane(m_pTabel);
return CMDIChildWndEx::OnCreateClient(lpcs, pContext);
}