Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Overview
  • Controls taken into account by the programmed Drag and Drop
  • Principle
  • Programmed Drag and Drop - Simplified mode
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
The programmed Drag and Drop is used to entirely manage Drag/Drop between the different types of controls. Depending on its type, the control can be source or target of Drag and Drop.
This help page presents:
Detailed examples for using the programmed Drag and Drop are available:
Controls taken into account by the programmed Drag and Drop
WINDEV The following controls are taken into account by the programmed Drag and Drop:
Source of Drag and Drop Target of Drag and Drop
Only the following controls:
  • Edit control
  • List box and listview
  • TreeView
  • Table
  • Image
  • Bar code
  • Button
  • Looper
  • Chart
  • TreeView Table
  • Calendar
  • Organizer
  • Scheduler
All types of controls except:
  • Progress Bar
  • ActiveX
  • OLE
  • Shape
  • Toolbar
  • HTML
  • Web camera
  • Video conference

Caution: the "Touch move" option must not be checked in the control description window. Otherwise, the programmed Drag and Drop will fail.
To perform a programmed Drag and Drop between several controls of a WINDEV application or WEBDEV site:
  1. In the initialization code of the source control:
    • Define that a programmed "Drag and Drop" will be performed (Property DndSource).
    • Define the procedure run at the beginning of the "Drag" action (DnDEvent for the dndBeginDrag event).
  2. In the initialization code of the target control:
    • Define that a programmed "Drag and Drop" will be performed (Property DndTarget).
    • Define the procedure run when hovering the control (DnDEvent for the dndDragOver event). In this procedure, you have the ability to define the mouse cursor with DnDCursor.
    • Define the procedure run during the "Drop" on the control (DnDEvent for the dndDrop event).
  3. In each one of the WLanguage procedures called, define the action to run via the "Drag and Drop" functions of WLanguage.

Programmed Drag and Drop - Simplified mode

To enable the programmed Drag and Drop, you also have the ability to enable the Drag and Drop processes in the code of the control.
This activation replaces the call of the DnDEvent function and the creation of the associated procedures. However, this simplified management is only available for the following types of controls:
  • Table,
  • TreeView,
  • TreeView Table,
  • Looper.
Equivalence between DnDEvent and the processes for managing Drag and Drop:
Full programmed mode
Constant used by DndEvent(Procedure Name, Control, Constant)
Simplified programmed mode
Process of the control
DndBeginDragBeginning of source Drag/Drop (DndBeginDrag)
DndEndDragEnd of source Drag/Drop (DndEndDrag)
DndDragEnterEntry in target Drag/Drop (DndDragEnter)
DndDragOverRollover in target Drag/Drop (DndDragOver)
DndDropDrop in target Drag/Drop (DndDrop)
DndDragLeaveExit in source Drag/Drop (DndDragLeave)

The procedure code will be inserted in the process of the control.
Related Examples:
Drag and drop Unit examples (WINDEV): Drag and drop
[ + ] Using Drag & Drop with the WLanguage functions.
The following topics are presented in this example:
1/ How to manage Drag&Drop between WINDEV controls
2/ How to manage Drag&Drop from the Windows file explorer to a WINDEV control
Drag & Drop is used to move objects via the mouse. "Drag" consists in clicking an object and moving the mouse while keeping the left button down. "Drop" consists in releasing the left mouse button.
Drag & Drop can be used with WINDEV on the List Box, TreeView, Table and Image controls.
The features of Drag And Drop HTML5 Unit examples (WEBDEV): The features of Drag And Drop HTML5
[ + ] Using the Drag n Drop HTML 5 features in a WEBDEV site.
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment