How can you disable the ''Tabbed Document '' option for docked controls

In an MDI form using TabbedMDIManager and a DockingManager, I want to prevent the 'Tabbed Document' option from appearing in the docking ropdown of the docked controls. Is there an easy way of achieving this?

3 Replies

MU Murugan Syncfusion Team January 11, 2007 03:24 PM UTC

Hi Guy,

This could be achieved by handling dockingManager1_DockContextMenu and dockingManager1_DockAllow events.

Here is the code snippet:

private void dockingManager1_DockContextMenu(object sender, Syncfusion.Windows.Forms.Tools.DockContextMenuEventArgs arg)
{
Syncfusion.Windows.Forms.Tools.XPMenus.PopupMenu p = arg.ContextMenu;
p.ParentBarItem.Items[2].Visible = false;
}

private void dockingManager1_DockAllow(object sender, Syncfusion.Windows.Forms.Tools.DockAllowEventArgs arg)
{
if (arg.DockStyle == Syncfusion.Windows.Forms.Tools.DockingStyle.Tabbed && arg.TargetControl == this )
{
arg.Cancel = true;
}
}

Herewith I have also attached the sample. Please have a look at the sample and let me know if it helps.

MDIChild

Thanks for choosing Syncfusion products.

Regards,
Murugan P.S


GM Guy Mahieu January 16, 2007 09:44 AM UTC

Thanks, it looks like it works. I decided to disable the context menu for the dockingmanager altogether though.

Guy


MU Murugan Syncfusion Team January 19, 2007 04:09 PM UTC

Hi Guy,

Thank you for your update.

Regards,
Murugan P.S

Loader.
Up arrow icon