• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 666
  • Last Modified:

Dockable Property Sheet

I know how to create a dockable dialogbar. However, it seems that the method cannot be applied in creating a property sheet. Please provide me with some guidance.
1 Solution
Hello, tseekoy, You got deeper into the topic. So, the Visual Sudio style interface is very attractive.
In fact, you can not create a dialog bar liked property sheet. But you can get ClassView style windows by a CControlBar, a CTabCtrl, and some other control.
Following is a sample, which introduce:
1.  Derive class from CControlBar.
2.  Override the CControlBar Create() memeber function. In Create, a CTabCtrl was Created, and a Edit Control, a Lis Control, a Tree Control were created.  If you want to the Tab has Icon, before the CTabCtrl created, a CImageList should be created
};BOOL COutputWnd::Create(CWnd* pParentWnd, DWORD dwStyle, UINT nID)
      ASSERT_VALID(pParentWnd);   // must have a parent

      // save the style
      m_dwStyle = (UINT)dwStyle;

      // create the HWND
      CRect rect;
      LPCTSTR lpszClass = AfxRegisterWndClass(0, ::LoadCursor(NULL, IDC_ARROW),
            (HBRUSH)(COLOR_BTNFACE+1), NULL);
      if (!CWnd::Create(lpszClass, NULL, dwStyle, rect, pParentWnd, nID))
            return FALSE;

      // Note: Parent must resize itself for control bar to be resized
      m_pTabCtrl=new CTabCtrl;
                        rect,this, IDC_TABCONTROL);
      m_pTerminal=new CEdit;
                        rect,this, IDC_EDITCTRL);
      m_pList      =CListCtrl;
      m_pList->Create(WS_CHILD|LVS_REPORT, rect,this, IDC_LISTCTRL);
      m_pTree      =CTreeCtrl;
      m_pTree-> Create(WS_CHILD| TVS_HASLINES| TVS_HASBUTTONS ,rect,this, IDC_TREECTRL);

      // set initial font and calculate bar height
      SendMessage(WM_SETFONT, (WPARAM)globalData.hStatusFont);
      return TRUE;
Notice, only one control has WS_VISIBLE style, only this control can bevisible after  creted

3 process Tab Control notification TCN_SELCHANGE, show selected pane, hide previous pane
void COutputWnd::OnTabCtrlSelchange(NMHDR* pNMHDR, LRESULT* pResult)
      //Hide all pane at first
      int cursel=m_TabCtrl.GetCurSel();
      m_pTree-> ModifyStyle(WS_VISIBLE,0);
      //      Then, show the selected pane
      case OUTPUT_TTY:
      case OUTPUT_LIST:
            m_pList->ModifyStyle(0, WS_VISIBLE);
      case OUTPUT_TREE:
            m_pTree->ModifyStyle(0, WS_VISIBLE);
4 Override OnSize Member to resize the controls when the Frame position or size changed.
void COutputWnd::OnSize(UINT nType, int cx, int cy)
      CControlBar::OnSize(nType, cx, cy);

      // adjust m_cxSizeBox if necessary

            RECT rc;
            rc.left+=5;rc.right-=5;            //Remove the border size
      // force repaint on resize (recalculate stretchy)


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now