Share via


DragMode Property

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

Control.DragMode[ = nMode]

Return Value

  • 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

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.

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

Reference

DragDrop Event

DragIcon Property

DragOver Event

KeyPress Event

MouseDown Event

MouseMove Event

MouseUp Event

OLEDragMode Property

Other Resources

Properties (Visual FoxPro)

Language Reference (Visual FoxPro)