Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - [SOLVED]TabControl HitTest
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED]TabControl HitTest

 Post Reply Post Reply
Author
Message
alif98 View Drop Down
Newbie
Newbie


Joined: 03 August 2016
Location: Norway
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote alif98 Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED]TabControl HitTest
    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?

Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 293
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.145 seconds.