locked
How to put CMFCOutlookBar in CDockablePane? RRS feed

  • Question

  • Hi,

    To make CMFCOutookbar dockable I want to put it in CDockablePane, How to achieve it?

    Can I get any sample code?

    Monday, March 27, 2017 12:31 PM

Answers

  • Hi RLWA32,

    Thanks for your reply.

    I am able to resize the navigation pane but unable to dock or move it.

    I am able to dock only the panes(Folders, Calendar) placed inside the outlookbar.

    I need dockable /movable outlookbar.

    override the CanFloat() method to return TRUE;

    class COutlookBar : public CMFCOutlookBar
    {
    	virtual BOOL AllowShowOnPaneMenu() const { return TRUE; }
    	virtual void GetPaneName(CString& strName) const { BOOL bNameValid = strName.LoadString(IDS_OUTLOOKBAR); ASSERT(bNameValid); if (!bNameValid) strName.Empty(); }
    public:	
    	virtual BOOL CanFloat() const;
    };
    

    • Edited by RLWA32 Tuesday, March 28, 2017 11:16 AM added snippet
    • Marked as answer by sgrm123 Wednesday, March 29, 2017 4:19 AM
    Tuesday, March 28, 2017 11:05 AM

All replies

  • CMFCOutlookBar is already dockable since it is derived from CDockablePane.  If you use the New Project wizard to create an MFC app and from the "Advanced Features" property page select "Navigation pane" the generated app will contain a docked CMFCOutlookBar.

    Wizard property page is -

    The generated app looks like this -

    • Proposed as answer by Baron Bi Tuesday, March 28, 2017 7:54 AM
    Monday, March 27, 2017 2:07 PM
  • Hi RLWA32,

    Thanks for your reply.

    I am able to resize the navigation pane but unable to dock or move it.

    I am able to dock only the panes(Folders, Calendar) placed inside the outlookbar.

    I need dockable /movable outlookbar.

    • Edited by sgrm123 Tuesday, March 28, 2017 9:39 AM
    Tuesday, March 28, 2017 9:38 AM
  • Hi RLWA32,

    Thanks for your reply.

    I am able to resize the navigation pane but unable to dock or move it.

    I am able to dock only the panes(Folders, Calendar) placed inside the outlookbar.

    I need dockable /movable outlookbar.

    override the CanFloat() method to return TRUE;

    class COutlookBar : public CMFCOutlookBar
    {
    	virtual BOOL AllowShowOnPaneMenu() const { return TRUE; }
    	virtual void GetPaneName(CString& strName) const { BOOL bNameValid = strName.LoadString(IDS_OUTLOOKBAR); ASSERT(bNameValid); if (!bNameValid) strName.Empty(); }
    public:	
    	virtual BOOL CanFloat() const;
    };
    

    • Edited by RLWA32 Tuesday, March 28, 2017 11:16 AM added snippet
    • Marked as answer by sgrm123 Wednesday, March 29, 2017 4:19 AM
    Tuesday, March 28, 2017 11:05 AM