RAD Studio VCL Reference
TControl.BeginDrag Method

Starts the dragging of a control.

procedure BeginDrag(Immediate: Boolean; Threshold: Integer = -1);
__fastcall BeginDrag(Boolean Immediate, int Threshold = -1);

Call BeginDrag to start a drag operation. BeginDrag is called in application code only when the value of the control's DragMode is dmManual. If DragMode is dmAutomatic, BeginDrag is called automatically. 

If the Immediate parameter is true, the mouse pointer changes to the value of the DragCursor property and dragging begins immediately. If Immediate is false, the mouse pointer doesn't change to the value of the DragCursor property and dragging doesn't begin until the user moves the mouse pointer the number of pixels specified by the Threshold parameter. If the caller passes a Threshold value less than 0 (such as the default value for this parameter), BeginDrag uses the DragThreshold property of the global Mouse variable. 

Setting Immediate to false allows the control to accept mouse clicks without beginning a drag-and-drop or drag-and-dock operation. 


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!