PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Programmed Drag and Drop: Example
DnDGetData (Example)
Programmed Drag and Drop: Example
The following code is used to copy/paste text data (CF_TEXT constant). When the data to copy/paste is text data, this data is retrieved.
//- - Initialize the target control ("EDT_Find")
EDT_Find..DndTarget = dndProgram
// Call the OnDrop procedure when the left mouse button
// is released on the target control named "EDT_Find"
DnDEvent("OnDrop", EDT_Find, dndDrop)
// Call the OnRollover procedure when the mouse cursor
// moves between the source control and the target control ("EDT_Find")
DnDEvent("OnRollover", EDT_Find, dndDragOver)
PROCÉDURE OnRollover()
// Available type of data?
IF DnDIsDataAvailable(CF_TEXT) = True THEN
// Cursor indicating the move
DnDCursor(dndMove)
ELSE
// Cursor indicating that the move is not allowed
DnDCursor(dndNone)
END
PROCÉDURE OnDrop()
ResRetrieve is string
// Available type of data?
IF DnDIsDataAvailable(CF_TEXT) = True THEN
// The move is allowed (but not the copy)
DnDAccept(dndMove)
ResRetrieve = DnDGetData(CF_TEXT)
ELSE
// No action is allowed
DnDAccept(dndNone)
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment