By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,110 Members | 990 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,110 IT Pros & Developers. It's quick & easy.

Detecting mouse clicks in the "empty" area of a WinForms TabControl

P: n/a
I've added a TabControl to my WinForms app, and added a couple of tabs to
the control.

The result is that the top strip of the TabControl contains the two tabs,
and then to the right of them is an empty area, above the tab content:
/ Tab 1 caption \ / Tab 2 caption \ XXXX empty space XXXX
I should stress that the empty space is within the bounds of the TabControl,
but there are no tab headers there to be clicked on. This is the space that
would be filled with the header for the third tab if I were to add one.

(I hope that makes sense!)

If I click in the empty space, no mouse events are fired by the TabControl.
This is a nuisance as I need to know that the user has clicked there. I get
mouse events when the user clicks on one of the tab headers, but not the
empty area.

Is there some way I can obtain mouse clicks for this area of the control?

--

(O)enone
Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
That area is not part of the control but rather the form (or other control
like a panel) behind it. The easiest way to handle this is probably dock a
tab control in a panel and handle the panels OnMouseClick event as you would
want to handle it.

"(O)enone" wrote:
I've added a TabControl to my WinForms app, and added a couple of tabs to
the control.

The result is that the top strip of the TabControl contains the two tabs,
and then to the right of them is an empty area, above the tab content:
/ Tab 1 caption \ / Tab 2 caption \ XXXX empty space XXXX
I should stress that the empty space is within the bounds of the TabControl,
but there are no tab headers there to be clicked on. This is the space that
would be filled with the header for the third tab if I were to add one.

(I hope that makes sense!)

If I click in the empty space, no mouse events are fired by the TabControl.
This is a nuisance as I need to know that the user has clicked there. I get
mouse events when the user clicks on one of the tab headers, but not the
empty area.

Is there some way I can obtain mouse clicks for this area of the control?

--

(O)enone
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.