To create a static splitter window, call the CreateStatic member function.
virtual BOOL CreateStatic( CWnd* pParentWnd, int nRows, int nCols, DWORD dwStyle = WS_CHILD | WS_VISIBLE, UINT nID = AFX_IDW_PANE_FIRST );
Parameters
The parent frame window of the splitter window.
The number of rows. This value must not exceed 16.
The number of columns. This value must not exceed 16.
Specifies the window style.
The child window ID of the window. The ID can be AFX_IDW_PANE_FIRST unless the splitter window is nestedinside another splitter window.
(2)CSplitterWnd::CreateView
Creates the panes for a static splitter window.
virtual BOOL CreateView( int row, int col, CRuntimeClass* pViewClass, SIZE sizeInit, CCreateContext* pContext );
Parameters
Specifies the splitter window row in which to place the newview.
Specifies the splitter window column in which to place the newview.
Specifies the CRuntimeClass of the new view.
Specifies the initial size of the new view.
A pointer to a creation context used to create the view (usuallythe pContext passed into the parentframe's overridden CFrameWnd::OnCreateClient member function in which the splitter window is being created).
All panes of a static splitter window must be created before theframework displays the splitter.
The framework also calls this member function to create newpanes when the user of a dynamic splitter window splits a pane,row, or column.
二、(1)OnCreateClient繪制與文檔對象和邊框窗口對象相聯系的視區。(2)在單個視類的切分窗口中,各個視區的內容是完全一致的,只要一個視類對象(3)切分窗口為多視類則,不同的切分窗口可以顯示不同的內容,因此要創建多個視類對象。三、代碼:(1)聲明切分窗口(可能要)CChildFrame類中加入 CSpliterWnd m_wndSplitter(2)在OnCreateClient加入代碼// this function creates the panes for a static splitter windowBOOL CChildFrame::OnCreateClient( LPCREATESTRUCT lpcs, CCreateContext* pContext){ BOOL bCreateSpltr = m_wndSplitter.CreateStatic( this, 2, 1); // COneView and CAnotherView are user-defined views derived from CMDIView m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(COneView), CSize(0,0), pContext); m_wndSplitter.CreateView(1,0,RUNTIME_CLASS(CAnotherView), CSize(0,0), pContext); return (bCreateSpltr);}
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
