I am writing a C# WinForm application. I have a Tab Control and I've already preset all functions such as adding new tabs by menu, and double clicking tabs to delete. My issue now is I want to create a tab every time I double click the empty grey space of the tab control.
I've been searching for about an hour now and a lot of what I find is dealing with WPF and I'd rather not delve into those anytime soon. So I'm looking for a matter to fit my means of detecting the double click. I've tried double click
and mouse double click
double click works on tabs, and mouse double click does the same except it captures the mouse event arguments. So then I'm able to use
e.Location
Except it only provides that information on the tabs themselves. Anyone have any suggestions to capture that double click outside the tabs themselves? I've tried go up in parents such as mouse double click on the window itself, tried creating a completely opaque element that may handle the clicks instead but I've hit a brick wall every time.
private void Tabs_MouseDoubleClick(object sender, MouseEventArgs e)
{
//only works when double clicking tabs
MessageBox.Show(e.Location.ToString());
}