Share via


CSplitterWnd::CreateStatic

BOOLCreateStatic(CWnd*pParentWnd,intnRows**,intnCols,DWORDdwStyle=WS_CHILD|WS_VISIBLE,UINTnID=AFX_IDW_PANE_FIRST);**

Return Value

Nonzero if successful; otherwise 0.

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.

Remarks

To create a static splitter window, call the CreateStatic member function.

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 in Visual C++ Programmer’s Guide, Technical Note 29, and the CSplitterWnd class overview for more on static splitter windows.

CSplitterWnd OverviewClass MembersHierarchy Chart

See Also   CSplitterWnd::Create, CFrameWnd::OnCreateClient, CSplitterWnd::SetRowInfo, CSplitterWnd::SetColumnInfo, CSplitterWnd::CreateView