Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLE Drag and Drop
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00325288
Message ID:
00325297
Views:
23
>Is the first time i'm doing Drag and Drop functionallity.
>I have two ListView in a form and try to pass values (rows) from one listview to the other draging from one side to the other.
>
>How can i do that?
>
>I was trying for all the day but doesn't work.
>Regular Drag and Drop doesn't work.
>
>
>Thanks.

I'm assuming your using the ListView ActiveX control. If that is the case you need to do some screen metric conversions. Here is some code that should go in the init of your form. Plus you need to add some properties to your form. I didn't write this code and I can't remember where I got it. It did help me do what I was trying to accomplish though.


**** Cut here
* Calculate the conversion factor between VFP window units (in pixels) and
* TreeView window units (in twips).

local liHWnd, ;
liHDC, ;
liPixelsPerInchX, ;
liPixelsPerInchY

* Define some constants.

#define cnLOG_PIXELS_X 88
* From WINGDI.H
#define cnLOG_PIXELS_Y 90
* From WINGDI.H
#define cnTWIPS_PER_INCH 1440
* 1440 twips per inch

* Declare some Windows API functions.

declare integer GetActiveWindow in WIN32API
declare integer GetDC in WIN32API ;
integer iHDC
declare integer GetDeviceCaps in WIN32API ;
integer iHDC, integer iIndex

* Get a device context for VFP.

liHWnd = GetActiveWindow()
liHDC = GetDC(liHWnd)

* Get the pixels per inch.

liPixelsPerInchX = GetDeviceCaps(liHDC, cnLOG_PIXELS_X)
liPixelsPerInchY = GetDeviceCaps(liHDC, cnLOG_PIXELS_Y)

* Get the twips per pixel.

with This
** add these custom properties to the form
.nTreeFactorX = cnTWIPS_PER_INCH/liPixelsPerInchX
.nTreeFactorY = cnTWIPS_PER_INCH/liPixelsPerInchY
endwith

*** end cut
Rip Ryness
International Falls, MN
Previous
Reply
Map
View

Click here to load this message in the networking platform