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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

TabbedMDIManager closing tabs using context menu.

Thread ID:





90437 Oct 1,2009 09:27 AM UTC Oct 21,2009 10:32 AM UTC WinForms 1
Tags: Tools
Accounts Payable
Asked On October 1, 2009 09:27 AM UTC

How do I enable the context menu to be opened on a tab that is not currently in focus? I want to enable the user to close the tab without having to draw the screen. Currently when you right click on a tab that is not in focus, this bring the tab into focus. I do not want this to happen.

Mano J [Syncfusion]
Replied On October 21, 2009 10:32 AM UTC

Hi James,

You can prevent the tab getting selected by cancelling the selected index changing event when right click is made.

private void tabbedMDIManager_TabControlAdded(object sender, Syncfusion.Windows.Forms.Tools.TabbedMDITabControlEventArgs args)
tabControl = args.TabControl;
tabControl.SelectedIndexChanging += new SelectedIndexChangingEventHandler(tabControl_SelectedIndexChanging);

void tabControl_SelectedIndexChanging(object sender, SelectedIndexChangingEventArgs args)
args.Cancel = (Control.MouseButtons == MouseButtons.Right);

But it will close only the active tab, not the tab under the mouse.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon