JavaScript Editor js editor     Web development 

Main Page

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

Control.DragMode[ = nMode]

Return Value


The settings for the DragMode property are:

Setting Description


(Default) Manual. Requires using the Drag method to initiate dragging of the source control.


Automatic. Clicking the source control automatically initiates dragging.


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

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.

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

See Also

JavaScript Editor js editor     Web development