Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Highlighting Node Item in TreeView (Like sample)
Message
From
26/04/2002 17:58:55
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00649792
Message ID:
00649825
Views:
22
This message has been marked as the solution to the initial question of the thread.
Because samples in MSDN for TreeView are written in VB, first some explanations:
1. Events of TreeView control return X, Y coordinates in scale units of TreeView container (most likely form). Form in VFP has only two scale modes - Foxels and (default) Pixels. Form in VB can have 7 scale modes (Twips, Points, Pixels, Chars, Inches, Millimeters, Centimeters).
2. HitTest() method of TreeView control expects X, Y coordinates in Twips, regardless of ScaleMode of tree's container.

In VB most container objects (Form, UserControl, etc.) have methods (ScaleX, ScaleY), with which you can convert every scale mode units in every other. Screen object in VB have properties, which gives relation between Pixels and Twips (TwipsPerPixelX and TwipsPerPixelY).

I write also on VFP from 2-3 years and till now not found converting equivalents of these functuons of VB in VFP. You best choice is to set ScaleMode of the form to Pixels and use TwipsPerPixelX = 15 and TwipsPerPixelY = 15. I.e. you must multiply X, Y coordinates, returned in tree events, by 15 and pass result to HitTest method.

I write on VB till now 6 years and not found system, on which TwipsPerPixelX <> 15 or TwipsPerPixelY <> 15.

Plamen Ivanov
MCSD .NET Early Achiever and MCAD .NET Charter Member (VB .NET/SQL Server 2000)
MCSD (VB 6.0/SQL Server 2000)

VB (.NET) - what other language do you need in the whole Universe?...

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform