Mouse over on tab image

Docking/MDI for Windows Forms Forum

Posted 18 years ago by Dean Vance - Central Ohio Hospitalists
Version: 2.0.62
I'm using the TabStrip control and I'd like to know when the mouse is over the image on a tab. My basic approach is to use the TabStripPageTabToolTopDisplaying event to know when I'm over a tab, and which one. I was planning on computing x/y position to determin that I'm over the image.

First, if there is a better way to do this, what is it?

Second, if no better way, how can I tell the width of each of the tabs on the control? For example, if there are three tabs, varying width, how can I add the widths of tab 1 and tab 2 so that I know tab 3 starts at x.

Thanks for your help!

Comments (1)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Dean,

You could probably do a hit test like this:
PointHitTestResult result = ((IUIElement)tabStrip).HitTestRecursive(new PointHitTestParameters(point));
If result.Element is a tab then you can look at its IUIElement properties like the bounds.

Hope that helps.

Actipro Software Support

The latest build of this product (v24.1.0) was released 4 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.