Doubleclicking Tab Control Header

I was interested in learning about this problem for some time - double-clicking the Winforms TabControl header is not detected, but I would like to handle this event.

It seems that all mouse events (clicking, moving, etc.) do not go up when they are in the β€œinactive” TabControl area. I even tried to subclass TabControl, but the events of the derived class also do not go up. The WndProc redefinition showed that it does not receive the WM_LBUTTONDBLCLK message (I mean - WTF?).

Thank. But I'm sure the tab control knows that I clicked on its title, it just doesn't let me know.

ps I looked at .NET: double-click an event in TabControl - but nothing

+3
source share
1 answer

Hm ... I completed a test project, and I get both MouseDoubleClick and DoubleClick events. What do you mean by tabcontrol? Would an actual tab or blank area be additional tabs?

I used eventspy.zip

If you mean a space (which you make by comment), then no, because there is nothing in the empty area. There is no control. What you need to do is put the TabControl in the Panel and set the TabControl Dock property to Fill. Access events with a double-click panel.

+2
source

Source: https://habr.com/ru/post/1735249/


All Articles