Поделиться через


CSplitterWnd::CreateStatic

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

  • pParentWnd
    The parent frame window of the splitter window.

  • nRows
    The number of rows. This value must not exceed 16.

  • nCols
    The number of columns. This value must not exceed 16.

  • dwStyle
    Specifies the window style.

  • nID
    The child window ID of the window. The ID can be AFX_IDW_PANE_FIRST unless the splitter window is nested inside another splitter window.

Return Value

Nonzero if successful; otherwise 0.

Remarks

A CSplitterWnd is usually embedded in a parent CFrameWnd or CMDIChildWnd object by taking the following steps:

  1. Embed a CSplitterWnd member variable in the parent frame.

  2. Override the parent frame's OnCreateClient member function.

  3. Call the CreateStatic member function from within the overridden CFrameWnd::OnCreateClient.

A static splitter window contains a fixed number of panes, often from different classes.

When you create a static splitter window, you must at the same time create all its panes. The CreateView member function is usually used for this purpose, but you can create other nonview classes as well.

The initial minimum row height and column width for a static splitter window is 0. These minimums, which determine when a pane is too small to be shown in its entirety, can be changed with the SetRowInfo and SetColumnInfo member functions.

To add scroll bars to a static splitter window, add the WS_HSCROLL and WS_VSCROLL styles to dwStyle.

See "Splitter Windows" in the article Multiple Document Types, Views, and Frame Windows, Technical Note 29, and the CSplitterWnd class overview for more on static splitter windows.

Requirements

Header: afxext.h

See Also

Reference

CSplitterWnd Class

Hierarchy Chart

CSplitterWnd::Create

CFrameWnd::OnCreateClient

CSplitterWnd::SetRowInfo

CSplitterWnd::SetColumnInfo

CSplitterWnd::CreateView