How to disable CDockablePane context menu?
-
Whenever I right-click on my CDockablePane, a context menu (Floating, Docking, Tabbed Document, Auto Hide, Hide) appear. How do I disable this?
Your in luck! I am currently working on a CDockablePane derived class. You need to overide CPane::OnShowControlBarMenu[^] Just tested it and it works. The really wierd thing is... the MSDN says:
TRUE if the menu can be displayed; otherwise, FALSE.
But... I had to do the exact opposite! Can you confirm this in your code? Best Wishes, -David Delaune
-
Your in luck! I am currently working on a CDockablePane derived class. You need to overide CPane::OnShowControlBarMenu[^] Just tested it and it works. The really wierd thing is... the MSDN says:
TRUE if the menu can be displayed; otherwise, FALSE.
But... I had to do the exact opposite! Can you confirm this in your code? Best Wishes, -David Delaune
-
CFieldPane is derived from CDockablePane.
BOOL CFieldPane::OnShowControlBarMenu(CPoint point)
{
return TRUE;
}Nothing happens. The context menu still appear :doh:
-
Whenever I right-click on my CDockablePane, a context menu (Floating, Docking, Tabbed Document, Auto Hide, Hide) appear. How do I disable this?
I simply overrode CDockablePane::OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/) to have the function do nothing and just return. Now when I right-click, the only context menu I see is the one from my CDialog window that I have embedded into my CDockablePane window. Before I did this, the CDockablePane context menu would pop up immediately after I selected an item from my CDialog window's context menu.