Print Page | Close Window

C# Tab Control HitTest

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=3118
Printed Date: 01 July 2024 at 8:12am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: C# Tab Control HitTest
Posted By: pchui
Subject: C# Tab Control HitTest
Date Posted: 27 October 2005 at 7:19pm

I'm trying to detect the TabControlItem clicked on by handling the TabControl.MouseUpEvent and then checking TabControl.HitTest(). It never succeeds because it appears that there needs to be a conversion from the MouseUpEvent x,y units to the one that HitTest() uses.

In the TabManager sample, I added the event handler

private void TabControl_MouseUpEvent(object sender, AxXtremeSuiteControls._DTabControlEvents_MouseUpEvent e)
{
    XtremeSuiteControls.TabControlItem item = TabControl.HitTest(e.x, e.y);
    if (item != null)
    {
     ...
    }
}

HitTest() always return null here. The e.y value from the MouseUpEvent is in the range of 0-16.

I tried the same code in VB, and it works. But the MouseUpEvent in VB returns y values of 0-300.

My tests with C++ show the same problem as C#.

 




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net