KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Programmatically rejecting the On Drag Over event
PRODUCT: 4D | VERSION: 2004 | PLATFORM: Mac & Win
Published On: October 21, 2005
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

It is possible to programmatically reject an On Drag Over event for an object method.

The source object will be dragged and dropped on the destination object.

1. In the User mode, open the Form editor

2. Enable the On Drag Over and On Drop event for the destination object’s Property List

3. Open the Method editor for the destination object

  a. To reject the drag, the object method must return -1 (minus one), so you write $0:=-1

  b. To accept the drag, the destination object method must return 0 (zero), so you write $0:=0

If you reject the drag, the destination is not highlighted. If you accept the drag, the destination object is highlighted.

Complete documentation can be found at: https://www.4d.com/docs/CMU/CMU10067.HTM