Splitter Windows

The left view is a tree view; the right view is a list view.

2025-11-27

Written by: xiaobin

MFC supports two types of splitter windows: static and dynamic.

splitter window - dynamic

Dynamic splitter windows are created with MFC’s CSplitterWnd::Create function. Creating and initializing a dynamic splitter window is a simple two-step procedure:

  1. Add a CSplitterWnd data member to the frame window class.
  2. Override the frame window’s virtual OnCreateClient function, and call CSplitterWnd::Create to create a dynamic splitter window in the frame window’s client area.

splitter window - static

The procedure for adding a static splitter window to a frame window goes like this.

  1. Add a CSplitterWnd data member to the frame window class.
  2. Override the frame window’s OnCreateClient function, and call CSplitterWnd::CreateStatic to create a static splitter window.
  3. Use CSplitterWnd::CreateView to create a view in each of the splitter window’s panes.

Using AppWizard to create an Explorer-style application.

(Before changes) Default items

list view - right

tree view - left

Ref