MFC single document split area (CSPLITTERWND)

Source: Internet
Author: User

Generated using the VS08 Program Wizard, single-document program, default settings. The project name is 3view;

Where the default generated view class Cmy3viewview, corresponding to 3viewview.h,3viewview.cpp;

The default generated document class is: 3viewdoc.h,3viewdoc.cpp;

In the main frame header file MainFrm.h, add the following header file;//For the sake of good back to create the program default view Cmy3viewview;

#include "3viewDoc.h"
#include "3viewView.h"

and add the following variables

CSplitterWnd M_wndsplitter;
CSplitterWnd M_WNDSPLITTERTB;
CSplitterWnd M_WNDSPLITTERTB2;

and overloading the OnCreateClient function

1BOOL cmainframe::oncreateclient (lpcreatestruct lpcs, ccreatecontext*pContext)2 {3     //Todo:add your specialized code here and/or call the base class4 CRect CT;5GetClientRect (&CT);6M_wndsplitter.createstatic ( This,1,3);//The main frame is divided around 1 rows and 3 columns7 8M_wndsplittertb.createstatic (&m_wndsplitter,2,1, ws_child| Ws_visible,m_wndsplitter.idfromrowcol (0,0));//in the 1th row of M_wndsplitter, the 1th column is divided into 2 rows and 1 columns .9M_wndsplittertb2.createstatic (&m_wndsplitter,3,1, ws_child| Ws_visible,m_wndsplitter.idfromrowcol (0,1));//in the 1th row of M_wndsplitter, the 2nd column is divided into 2 rows and 1 columns .Ten  OneM_wndsplittertb.createview (0,0, Runtime_class (Cdefformview), CSize (Ct. Width ()/3Ct. Height ()/2), PContext);//Create 1th row 1th column view in M_WNDSPLITTERTB AM_wndsplittertb.createview (1,0, Runtime_class (Cdefformview), CSize (Ct. Width ()/3Ct. Height ()/2), PContext);//Create 2nd row 1th column view in M_WNDSPLITTERTB -  -M_wndsplittertb2.createview (0,0, Runtime_class (Cdefformview), CSize (Ct. Width ()/3Ct. Height ()/3), PContext);//Create 1th row 1th column view in M_WNDSPLITTERTB2 theM_wndsplittertb2.createview (1,0, Runtime_class (Cmy3viewview), CSize (Ct. Width ()/3Ct. Height ()/3), PContext);//Create 2nd row 1th column view in M_WNDSPLITTERTB2 -M_wndsplittertb2.createview (2,0, Runtime_class (Cdefformview), CSize (Ct. Width ()/3Ct. Height ()/3), PContext);//Create 3rd row 1th column view in M_WNDSPLITTERTB2 -  -M_wndsplitter.createview (0,2, Runtime_class (Cmy3viewview), CSize (Ct. Width ()/3,0), PContext);//Create a view of the 1th row 3rd column of the main frame +      -     //get the object of the corresponding view +cmy3viewview* view = (Cmy3viewview *) M_wndsplitter.getpane (0,2); Acdefformview* view2 = (cdefformview*) M_wndsplittertb.getpane (0,0); at  -M_is_spilit =TRUE; -     returnTRUE; -     //return CFrameWnd::OnCreateClient (LPCs, pContext); -}

MFC single document split area (CSPLITTERWND)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.