Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TreeView.HitTest returns invalid reference
Message
 
À
02/03/2004 05:52:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00882283
Message ID:
00882350
Vues:
27
In your app startup you would need code similar to this:
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
* In the treeviews mouse move you would need something like
procedure MouseMove(button, shift, x, y)
IF thisform.chkHotTracker.Value
   oNode=this.HitTest(X*unLTVX,Y*unltvY)
   if type('oNode.text')==[C]
      this.NodeClick(oNode)
   else
   ENDIF 
ELSE 
ENDIF
ENDPROC
You need to assure the node exists {if type('oNode.text')==[C]}, before you treat it like one:)

There is a demo of this in download #16575

>Hi there,
>
>Has anyone used the TreeView.HitTest method before and have it return a reference which is not a Node?
>
>oNode = TreeView.HitTest(x,y)
>? TYPE('oNode') && returns "O"
>? oNode.Text && returns "oNode is not an object"
>
>Any insights to the problem will be appreciated.
>
>Thanks
Imagination is more important than knowledge
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform