// Tab Context Menu private void TabContMenu_Opening(object sender, CancelEventArgs e) { Point p = Control.MousePosition; Rectangle rTab; for (int i = 0; i <= TabControl1.TabCount - 1; i++) { rTab = TabControl1.RectangleToScreen(TabControl1.GetTabRect(i)); if (rTab.Contains(p)) { TabControl1.SelectedIndex = i; break; } } }