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

Context Menu For TabPage Header

Thread ID:

Created:

Updated:

Platform:

Replies:

46777 Jul 20,2006 11:45 AM UTC Jul 20,2006 02:47 PM UTC WinForms 1
loading
Tags: Tools
Max Hillaert
Asked On July 20, 2006 11:45 AM UTC

Hi,

How do I implement a ContextMenu (Syncfusion''s or WinForm''s) that only pops up when right clicking the TabPage Header , not the TabPage itself like in VS2003/2005.

Cheers





Mano J [Syncfusion]
Replied On July 20, 2006 02:47 PM UTC

Hi Max,

Thanks for using Essential Tools.

You have to get selected tab header bounds using GetTabRect method and show the winforms context menu if the mouse up occurs inside the tab rect.

private void tabControlAdv1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
Rectangle rect = this.tabControlAdv1.GetTabRect(this.tabControlAdv1.SelectedIndex);
Point pt = new Point(e.X ,e.Y);
if(rect.Contains(pt))
{
this.contextMenu1.Show(this.tabControlAdv1, pt);
}
}

I have attached a sample. Please refer to it and let me know if this helps you.

Regards,
Mano

Sample_tabControlAdv.zip

CONFIRMATION

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.

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

;