Skip to main content
Version: 20 R6

On Begin Drag Over

CodeCan be called byDefinition
174D Write Pro area - Button - Button Grid - Check Box - Dropdown list - Form - Hierarchical List - Input - List Box - List Box Column - Picture Button - Picture Pop up menu - Plug-in Area - Progress Indicators - Radio Button - Ruler - Spinner - Splitter - Stepper - Tab controlAn object is being dragged

Description

The On Begin Drag Over form event can be selected for any form objects that can be dragged. It is generated in every case where the object has the Draggable property. It can be called from the method of the source object or the form method of the source object.

Unlike the On Drag Over form event, On Begin Drag Over is called within the context of the source object of the drag action.

The On Begin Drag Over event is useful for preparing of the drag action. It can be used to:

  • Add data and signatures to the pasteboard (via the APPEND DATA TO PASTEBOARD command).
  • Use a custom icon during the drag action (via the SET DRAG ICON command).
  • Accept or refuse dragging via $0 in the method of the dragged object.
    • To indicate that drag actions are accepted, the method of the source object must return 0 (zero); you must therefore execute $0:=0.
    • To indicate that drag actions are refused, the method of the source object must return -1 (minus one); you must therefore execute $0:=-1.
    • If no result is returned, 4D considers that drag actions are accepted.

4D data are put in the pasteboard before calling the event. For example, in the case of dragging without the Automatic Drag action, the dragged text is already in the pasteboard when the event is called.