I was wondering if anyone knew how to do a hit test on the tabcontrol. I want to allow a user to right click only on the tab header and display options from a context menu strip. The problem is if I set the Tab Control context menu to my menu then the user can click anywhere they want. I need to be able to restric them to only right clicking on the Active tabs header. Any help would be great.
Thanks
Chris.
If you are using a .NET context menu strip, I think you can just remove the items to prevent the menu from showing. If you are using a PopupMenuTool from a toolbars manager, you can handle the BeforeToolDropdown event. In your event handler, if the SourceControl of the event args is your tab control, check the point that was clicked and if it is not over a tab item, set Cancel on the event args to True.
Mike Dour"]The tab control has a TabFromPoint method which you can use to determine which tab item is at a specific point in client coordinates of the tab control.
The tab control has a TabFromPoint method which you can use to determine which tab item is at a specific point in client coordinates of the tab control.
Is there a way for me to stop the context menu showing if I already have it assinged to the tab control. If they do not click on the selcted tab I dont want context menu to popup.
Thnaks,
Chris