MFC DockablePane not floating or hiding

老子叫甜甜 提交于 2019-12-11 14:14:12

问题


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?


回答1:


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




回答2:


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




回答3:


Another solution is, just call

CBasePane::SetControlBarStyle(AFX_CBRS_RESIZE|AFX_CBRS_CLOSE);


来源:https://stackoverflow.com/questions/469083/mfc-dockablepane-not-floating-or-hiding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!