Print Page | Close Window

[SOLVED]TabControl HitTest

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=23085
Printed Date: 29 March 2024 at 7:30am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED]TabControl HitTest
Posted By: alif98
Subject: [SOLVED]TabControl HitTest
Date Posted: 03 August 2016 at 9:28am
Hi there,

I have strange result with TabControl HitTest function:

It seems okay with first tabitem

It started to be off on second item


And getting worse



Here's the code that I used on MouseMove
Private Sub TabControl1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As stdole.OLE_XPOS_PIXELS, ByVal y As stdole.OLE_YPOS_PIXELS)
  With TabControl1
    Dim item As TabControlItem
    Set item = TabControl1.HitTest(x, y)
    If Not item Is Nothing Then
      FlatEdit1.Text = item.Caption & vbTab & item.Index
    End If
  End With
End Sub


It seems that I need to offset X and Y by some value but I am not sure how much. Any clue on this issue?




Replies:
Posted By: agontarenko
Date Posted: 06 October 2016 at 7:03am
Hello,

Change you please code as below
Private Sub TabControl1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)

Regards,
Artem Gontarenko



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