TreeView HitTest not working

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jan 2008
Posts: 56
Reputation: Tekito is an unknown quantity at this point 
Solved Threads: 0
Tekito Tekito is offline Offline
Junior Poster in Training

TreeView HitTest not working

 
0
  #1
Oct 14th, 2008
(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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 56
Reputation: Tekito is an unknown quantity at this point 
Solved Threads: 0
Tekito Tekito is offline Offline
Junior Poster in Training

Re: TreeView HitTest not working

 
0
  #2
Oct 14th, 2008
Disregard the extra 'Integer' declaration in my first post ... not sure how that got in there.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC