>Hi Dragan,
>
>Here's a prototype code that seems to do what you want
I have to slap myself - this is something I was using years ago and completely forgotten about it. That's how I handle the treeviews in my own code. Well... looked it up and I actually have a very simplified version of this (assumes 15 twips per pixel) - and my version doesn't try to loop closer to the node. Mmmm... yes, this is much better :). Благодарю.
>
>* 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?