943,667 Members | Top Members by Rank

Ad:
Oct 14th, 2008
0

TreeView HitTest not working

Expand Post »
(I'm using VBA with Excel 2003, have references to OLE Automation and Microsoft Common Controls 6.0). The Hittest with my Treeview control does not seem to be working. I'm using it in a MouseDown event. The X and Y coordinates are being passed properly and are the correct values, but every time the node is always set to the top one, regardless of where I click on the Treeview window (yes I have more than one node). Code Below:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub TreeView1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As stdole.OLE_XPOS_PIXELS, ByVal Y As stdole.OLE_YPOS_PIXELS)
  2.  
  3. Set dragNode = TreeView1.HitTest(X, Y)
  4.  
  5. End Sub

No matter where I click, even though X and Y change, dragNode always set to first node.
Last edited by Tekito; Oct 14th, 2008 at 12:19 pm.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Tekito is offline Offline
56 posts
since Jan 2008
Oct 14th, 2008
0

Re: TreeView HitTest not working

Disregard the extra 'Integer' declaration in my first post ... not sure how that got in there.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Tekito is offline Offline
56 posts
since Jan 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Faster way to pick a option than Select Case in VB 6?
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Getting computer name or IP





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC