Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
C++
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.
Posted
Updated 16-Apr-18 22:57pm
v2

1 solution

You can find a solution here: How to Hide <close> Menu in CDockablePane[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900