共用方式為


CSplitterWnd::CreateView

建立靜態分隔視窗的窗格。

virtual BOOL CreateView(
   int row,
   int col,
   CRuntimeClass* pViewClass,
   SIZE sizeInit,
   CCreateContext* pContext 
);

參數

  • row
    指定要放置新檢視分隔視窗的行為。

  • col
    指定要放置新檢視分隔視窗的資料行。

  • pViewClass
    指定新的檢視上 CRuntimeClass

  • sizeInit
    指定新檢視的初始大小。

  • pContext
    要用來建立內容的指標建立檢視 (通常 pContext 傳入分隔視窗建立) 的父框架的覆寫 CFrameWnd::OnCreateClient 成員函式。

傳回值

如果不是零,則成功,則為 0。

備註

靜態分隔視窗的所有窗格,架構會顯示分隔器之前,必須先建立。

如果動態分隔視窗的使用者分割窗格、資料列或資料行時,架構會呼叫此成員函式來建立新的窗格。

範例

// this function creates the panes for a static splitter window
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
{
   m_bSplitterCreated = m_wndSplitter.CreateStatic(this, 1, 2);
   // CMyView and CMyOtherView are user-defined views derived from CView
   m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CMyView), CSize(0, 0), 
      pContext);
   m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CMyOtherView), CSize(0, 0), 
      pContext);

   return (m_bSplitterCreated);
}

需求

Header: afxext.h

請參閱

參考

CSplitterWnd 類別

階層架構圖

CSplitterWnd::Create