Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I use the drag and drop
Message
From
13/07/2010 05:19:38
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
12/07/2010 22:43:58
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01472299
Message ID:
01472322
Views:
73
>I'm trying to use the drag and drop on a foxpro control other then the grid. For example, I'm trying to get the drag and drop to work on the image control. I have the drag and drop enabled for the control but when I try to drag a jpg file onto it during run time the cursor turns into a circle with a line though it. How can I get it to work?

Here is a quick sample:
Public loForm
loForm = Createobject('SampleForm')
loForm.Show()

Define Class SampleForm As Form
  Add Object myImage As Image With Top = 10, Left = 10, Height = 100, Width = 100, OLEDropMode=1

  Procedure myImage.OLEDragDrop
    Lparameters oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord
    If oDataObject.GetFormat(15)	&& Files CF_DROP
      Local Array laFiles[1]
      oDataObject.GetData(15, @laFiles )
      This.Picture = laFiles[1]
    Endif
  Endproc

  Procedure myImage.OLEDragOver
    Lparameters oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord, nState
    If m.nState == 0 And oDataObject.GetFormat(15) &&DRAG_ENTER and Files CF_HDROP
      This.OLEDropHasData = 1 &&DROPHASDATA_USEFUL
      This.OLEDropEffects = 4 &&DROPEFFECT_LINK
    Else
      This.OLEDropHasData = 0 &&DROPHASDATA_NOTUSEFUL
    Endif
  Endproc
Enddefine
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform