Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Treeview node click - click on text only
Message
 
 
To
25/07/2007 08:13:41
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Miscellaneous
Thread ID:
01243424
Message ID:
01243472
Views:
70
Likes (1)
Hi Dragan,

Here's a prototype code that seems to do what you want
* MoseDown
*** ActiveX Control Event ***
LPARAMETERS button, shift, x, y
declare integer GetActiveWindow in WIN32API
declare integer GetDC in WIN32API integer iHDC
declare integer GetDeviceCaps in WIN32API integer iHDC,integer iIndex
* Device context
liHwnd=GetActiveWindow()
liHDC=GetDC(liHwnd)
* Pixels per Inch
liPixelsPerInchX=GetDeviceCaps(liHDC,88)
liPixelsPerInchY=GetDeviceCaps(liHDC,90)
* Twips per pixel and store
unLTVX=1440/liPixelsPerInchX
unLTVY=1440/liPixelsPerInchY
oNode=this.HitTest(x*unLTVX,Y*unLTVY)
IF NOT ISNULL(oNode)
	RETURN
ENDIF

FOR ix = 1 TO x
	oNode = this.HitTest(ix*unLTVX,Y*unLTVY)
	IF NOT ISNULL(oNode)
  	        this.NodeClick(oNode)
	        this.SelectedItem = oNode
		EXIT
	ENDIF
ENDFOR
>This is probably very old, and maybe someone remembers.
>
>A treeview will select the current node but will not register a nodeclick if it's clicked anywhere to the right of the node's caption. There was a thought that this may be solved by simply adding spaces, but then it would cause the horizontal scrollbar to appear (which we don't want).
>
>The treeview used in Windows Explorer, however, behaves differently - you click to the right and the node expands, the right pane is refreshed etc. So... is the treeview we know different, obsolete, buggy, or we just don't know how to get the desired behavior?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform