We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

TabbedMDIManager & DockingManager Context Menus

Hi,

I am using both a TabbedMDIManager & DockingManager.

Some of my dockable windows are set as tabs in the mdi container.

When the user right clicks on a tab, I would like to:

1) not show the context menu when right clicking on a MDI Form tab (i.e. not a docked window), and

2) to show the context menu for the tabbed docked windows with the TabbedMDIManager context menu items removed (create new horizontal tab, etc) and show only the DockingManager items (dockable, floating, etc).

Can you please let me know how can this be achieved?

Thanks in advance,
Mitul


1 Reply

AD Administrator Syncfusion Team November 28, 2007 10:02 AM UTC

Hi Mitul,

Thank you for your interest in Syncfusion products.

Removing TabbedMDIManager Context menu items on tabbed docked Form.

If you wish to remove TabbedMDIManager Context menu items on tabbed docked Form, then you could do so by
deriving from TabbedMDIManager as shown below :

[C#]

public class CustomTabbedMDIManager : TabbedMDIManager
{
public CustomTabbedMDIManager() : base() { }
protected override void ContextMenu_BeforePopup(object sender, CancelEventArgs e)
{

ParentBarItem popupMenuParentBarItem = sender as ParentBarItem;
foreach (BarItem bitem in popupMenuParentBarItem.Items)
{

if (bitem.Text == "&Close" || bitem.Text == "New Hori&zontal Tab Group" || bitem.Text == "New &Vertical Tab Group")
{
popupMenuParentBarItem.Items.Clear();
break;

}
e.Cancel = true;

}

base.ContextMenu_BeforePopup(sender, e);
}
}

Here is a sample for your reference.

http://websamples.syncfusion.com/samples/Tools.Windows/F70117/main.htm

In the sample, make the docked window to tabbed document using 'Tabbed Document' option. In the TabbedMDIForm, right click it to see the dock options.

Please let me know if this helps you.

Regards,
Jaya


Loader.
Live Chat Icon For mobile
Up arrow icon