没有关闭按钮的Cdockablepane

没有关闭按钮的Cdockablepane

本文介绍了没有关闭按钮的Cdockablepane的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我的应用程序中有2个单独的可停靠窗格



我可以删除关闭通过删除创建函数中的标志AFX_CBRS_CLOSE,每个CDockablePane中的按钮。



如果它们在帧上分开,则它们没有关闭按钮,但是只要我将它们组合到相同的标签中,关闭按钮出现。







请帮帮我。



谢谢。



我的尝试:



为了解决这个问题,我覆盖了虚拟CTabbedPane * CreateTabbedPane()函数;在每个子类的dockablepane类中。

 CTabbedPane * CClassView :: CreateTabbedPane()
{
CTabbedPane * pTabbedPane = CDockablePane :: CreateTabbedPane();
ASSERT_VALID(pTabbedPane);
// 删除AFX_CBRS_CLOSE标志;
#define AFX_NON_CLOSE_DOCKING_PANE_STYLEAFX_CBRS_FLOAT | AFX_CBRS_RESIZE | AFX_CBRS_AUTOHIDE
pTabbedPane-> SetControlBarStyle(AFX_NON_CLOSE_DOCKING_PANE_STYLE);
pTabbedPane-> RecalcLayout();
return pTabbedPane;
}



清除注册表设置后,第一次执行应用程序时,包含多个dockablepanes的选项卡式窗格没有关闭按钮。



当重新打开应用程序而不对其执行任何操作时,包含多个可停靠窗格的选项卡式窗格具有关闭按钮。



我在下面的onedrive路径上分享了在VS2008中创建的示例应用程序。







在我的示例应用程序中,tabbedpane有2个可停靠的窗格,名为fileview和classview。



在vs2015中我也是面临同样的问题。



我不想清除注册每次打开应用程序之前都要设置。

解决方案

Hi,

I have 2 separate dockable panes in my application

I can remove close button in each CDockablePane by removing the flags "AFX_CBRS_CLOSE" in the create function.

If they are separated on frame, they are not having close button, but as soon as I combine them into the same tabs, the close button are showing up.



Please help me.

Thanks.

What I have tried:

To resolve this problem I overrode the function virtual CTabbedPane*CreateTabbedPane(); in each subclassed dockablepane class.

CTabbedPane* CClassView::CreateTabbedPane()
{
CTabbedPane* pTabbedPane = CDockablePane::CreateTabbedPane();
ASSERT_VALID(pTabbedPane);
// remove AFX_CBRS_CLOSE flag;
#define AFX_NON_CLOSE_DOCKING_PANE_STYLEAFX_CBRS_FLOAT | AFX_CBRS_RESIZE | AFX_CBRS_AUTOHIDE
pTabbedPane->SetControlBarStyle(AFX_NON_CLOSE_DOCKING_PANE_STYLE);
pTabbedPane->RecalcLayout();
return pTabbedPane;
}


After clearing the registry setting, When executing the application first time, the tabbed pane which contains multiple dockablepanes has no close button.

When just reopening the application without doing anything on it, the tabbed pane which contains multiple dockable panes has close button.

I shared the sample application created in VS2008 in the below onedrive path.

https://aspiresysinc-my.sharepoint.com/:u:/g/personal/sujitha_ramamoorthy_aspiresys_com/EXpl4YmZ9JlAqTz4w_YKIJsBcOziO9tyNsqF9UFBub8-0w?e=dntvIa

In my sample application the tabbedpane has 2 dockable panes named fileview and classview.

In vs2015 also I am facing same problem.

I dont want to clear the registry settings each time before opening the application.

解决方案


这篇关于没有关闭按钮的Cdockablepane的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 17:59