MFC DockablePane not floating or hiding

2019-09-11 10:06发布

Is there any way to make a MFC DockablePane (from the new Feature Pack) that is docked in a window not able to float or to hide (and even disable the context menu that allows the user to select the states - dockable, float, hide etc.)

What I basically want is to have 3 panes on a window that can change their horizontal dimensions, but not their position inside the window. Any suggestion?

3条回答
孤傲高冷的网名
2楼-- · 2019-09-11 10:32

The solution is to extend the CDockablePane and override in this class the following events:

virtual BOOL CanFloat() const;
virtual BOOL CanBeClosed() const;
virtual BOOL CanAutoHide() const;

so that they return FALSE;

for more information see MSDN Customization Tips for the MFC Extensions

查看更多
Evening l夕情丶
3楼-- · 2019-09-11 10:33

Another solution is, just call

CBasePane::SetControlBarStyle(AFX_CBRS_RESIZE|AFX_CBRS_CLOSE);
查看更多
叛逆
4楼-- · 2019-09-11 10:38

Try changing the dwControlBarStyle when you create the window (with CDockablePane::Create).

查看更多
登录 后发表回答