Is it possible to split CView window with CSpliterWnd just like frame window?
-
Hi,
Is it possible to split view windows like frame frame window with CSplitterWnd?
class CMyWnd : public CView
{
protected:
DECLARE_DYNCREATE(CMyWnd)public:
CMyWnd();
virtual ~CMyWnd();
CSplitterWnd m_sp;
};BOOL CMyWnd::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{m_sp.Create(this, 1,2, CSize(10, 10),
pContext);//CAView is subclass of CView.
if(!m_sp.CreateView(0, 0,RUNTIME_CLASS(CAview), CSize( 100, 300), pContext))return FALSE;
//CCview is subclass of CView.
if(!m_sp.CreateView(0, 1,RUNTIME_CLASS(CCview), CSize(400, 300), pContext))return FALSE;
return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
}After doing above, to make window I did as followings.
program die...
Is it possible to split CView window with SplitterWnd?CMyWnd *p = new CMyWnd;
p->Create(NULL, NULL, WS_CHILDWINDOW | WS_CLIPSIBLINGS | WS_OVERLAPPED | WS_VISIBLE|WS_BORDER,
CRect (10,80, 1280,1024), this, 100, NULL);p->ShowWindow(SW_SHOW);