Platforms to show: All Mac Windows Linux Cross-Platform
WindowsDropTargetMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Drag & Drop | MBS Win Plugin | 10.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
It contains methods used in any application that can be a target for data during a drag-and-drop operation. A drop-target application is responsible for:
- Determining the effect of the drop on the target application.
- Incorporating any valid dropped data when the drop occurs.
- Communicating target feedback to the source so the source application can provide appropriate visual feedback such as setting the cursor.
- Implementing drag scrolling.
- Registering and revoking its application windows as drop targets.
The WindowsDropTargetMBS class contains methods that handle all these responsibilities except registering and revoking the application window as a drop target, for which you must call the AttachToWindow functions.
When To Implement
Implement the WindowsDropTargetMBS interface if you are developing an application that can act as a target for a drag-and-drop operation. The WindowsDropTargetMBS interface is associated with your application windows and is implemented on your window objects. Call the AttachToWindow function to register your window objects as drop targets.
When To Use
You do not call the methods of WindowsDropTargetMBS directly. The DoDragDrop function calls the WindowsDropTargetMBS methods during the drag-and-drop operation.
For example, DoDragDrop calls WindowsDropTargetMBS.DragEnter when it detects the mouse has moved over a window that is registered as a drag target. After the mouse has entered a drag-target window, DoDragDrop calls WindowsDropTargetMBS.DragOver as the mouse moves through the window and calls WindowsDropTargetMBS.DragLeave if the mouse leaves the target window or if the user cancels or completes the drag-and-drop operation. DoDragDrop calls WindowsDropTargetMBS.Drop if the drop finally occurs.
To see the ghost picture of the drag, please register a WindowsDragSourceMBS for the same window.
While the drag classes compile for Web Edition, they run on the server, so they have no effect on the client browser!
- 4 events
- event DragEnter(dataObject as WinDataObjectMBS, keystate as Integer, x as Integer, y as Integer, byref effect as Integer) as Integer
- event DragLeave as Integer
- event DragOver(keystate as Integer, x as Integer, y as Integer, byref effect as Integer) as Integer
- event Drop(dataObject as WinDataObjectMBS, keystate as Integer, x as Integer, y as Integer, byref effect as Integer) as Integer
- 2 properties
- 4 methods
- method AttachToControl(ctl as control, showDragImage as boolean = true) as Integer
- method AttachToControl(ctl as DesktopControl, showDragImage as boolean = true) as integer
- method AttachToWindow(win as DesktopWindow, showDragImage as boolean = true) as integer
- method AttachToWindow(win as window, showDragImage as boolean = true) as Integer
- 17 constants
Constants
Constant | Value | Description |
---|---|---|
DROPEFFECT_COPY | 1 | One of the drop effect constants. Drop results in a copy. The original data is untouched by the drag source. more |
DROPEFFECT_LINK | 4 |
One of the drop effect constants.
Drag source should create a link to the original data. |
DROPEFFECT_MOVE | 2 |
One of the drop effect constants.
Drag source should remove the data. |
DROPEFFECT_NONE | 0 |
One of the drop effect constants.
Drop target cannot accept the data. |
DROPEFFECT_SCROLL | &h80000000 |
One of the drop effect constants.
Scrolling is about to start or is currently occurring in the target. This value is used in addition to the other values. |
E_INVALIDARG | &h80070057 |
One of the OLE error codes.
An invalid argument was passed. |
E_OUTOFMEMORY | &h80000002 |
One of the OLE error codes.
There was insufficient memory available for this operation. |
E_UNEXPECTED | &h8000FFFF |
One of the OLE error codes.
An unexpected error has occurred. |
MK_CONTROL | 8 |
One of the key state constants.
The CTRL key is down. |
MK_LBUTTON | 1 |
One of the key state constants.
The left mouse button is down. |
MK_MBUTTON | &h10 |
One of the key state constants.
The middle mouse button is down. |
MK_RBUTTON | 2 |
One of the key state constants.
The right mouse button is down. |
MK_SHIFT | 4 |
One of the key state constants.
The SHIFT key is down. |
MK_XBUTTON1 | &h20 |
One of the key state constants.
The first X button is down. |
MK_XBUTTON2 | &h40 |
One of the key state constants.
The second X button is down. |
S_FALSE | 1 | One of the OLE error codes. |
S_OK | 0 | One of the OLE error codes. |
This class has no sub classes.
Some examples using this class:
- /Win/Drag and Drop/Attachment Drop from Outlook
- /Win/Drag and Drop/File Drag Multi
- /Win/Drag and Drop/File Drop
- /Win/Drag and Drop/Picture Drop
- /Win/Drag and Drop/Picture Drop on control
- /Win/Drag and Drop/Text Drop
Blog Entries
The items on this page are in the following plugins: MBS Win Plugin.
WindowsDriveNotificationMBS - WindowsEthernetAdapterMBS