DragMode Property

Specifies manual or automatic drag mode for a drag-and-drop operation. Available at design time and run time.

Control.DragMode[ = nMode]

Property Values

  • nMode
    The settings for the DragMode property are:
    Setting Description
    0 (Default) Manual. Requires using the Drag method to initiate dragging of the source control.
    1 Automatic. Clicking the source control automatically initiates dragging.

Remarks

When DragMode is set to 0 (Manual), the control responds to mouse events and the Drag method must be used to begin drag operations.

When DragMode is set to 1 (Automatic), the control does not respond to mouse events, and drag operations begin automatically when the user presses and holds the primary (left) mouse button over the control.

Releasing the mouse button while the mouse pointer is over a target control or form during a drag operation generates a DragDrop event for the target object and ends the drag operation. Dragging can also trigger a DragOver event.

Note   While a control is being dragged, it does not receive other user-initiated mouse or keyboard events (KeyPress, MouseDown, MouseMove, or MouseUp).

See Also

DragDrop Event | DragIcon Property | DragOver Event | KeyPress Event | MouseDown Event | MouseMove Event | MouseUp Event | OLEDragMode Property

Applies To: CheckBox | ComboBox | CommandButton | CommandGroup | Container Object | Control Object | EditBox | Grid | Image | Label | Line | ListBox | OLE Bound Control | OLE Container Control | OptionButton | OptionGroup | Page | PageFrame | Shape | Spinner | TextBox