Table of contents
TOC
Collapse the table of content
Expand the table of content

BeforeDragOver Event

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Occurs when a drag-and-drop operation is in progress. Syntax For Frame Private SubobjectBeforeDragOver( ByVal_CancelAs MSForms.ReturnBoolean, ctrlAs Control, ByValDataAs DataObject, ByValXAs Single, ByValYAs Single, ByValDragStateAs fmDragState, ByValEffectAs MSForms.ReturnEffect, ByValShiftAs fmShiftState) For MultiPage Private SubobjectBeforeDragOver(_indexAs Long, ByValCancelAs MSForms.ReturnBoolean, ctrlAs Control, ByValDataAs DataObject, ByValXAs Single, ByValYAs Single, ByValDragStateAs fmDragState, ByValEffectAs MSForms.ReturnEffect, ByValShiftAs fmShiftState) For TabStrip Private SubobjectBeforeDragOver(_indexAs Long, ByValCancelAs MSForms.ReturnBoolean, ByValDataAs DataObject, ByValXAs Single, ByValYAs Single, ByValDragStateAs fmDragState, ByValEffectAs MSForms.ReturnEffect, ByValShiftAs fmShiftState) For other controls Private SubobjectBeforeDragOver( ByVal_CancelAs MSForms.ReturnBoolean, ByValDataAs DataObject, ByValXAs Single, ByValYAs Single, ByValDragStateAs fmDragState, ByValEffectAs MSForms.ReturnEffect, ByValShiftAs fmShiftState) The BeforeDragOver event syntax has these parts:

PartDescription
objectRequired. A valid object name.
indexRequired. The index of the Page in a MultiPage that the drag-and-drop operation will affect.
CancelRequired. Event status. False indicates that the control should handle the event (default). True indicates the application handles the event.
ctrlRequired. The control being dragged over.
DataRequired. Data that is dragged in a drag-and-drop operation. The data is packaged in a DataObject.
X, YRequired. The horizontal and vertical coordinates of the control's position. Both coordinates are measured in points. X is measured from the left edge of the control; Y is measured from the top of the control..
DragStateRequired. Transition state of the data being dragged.
EffectRequired. Operations supported by the drop source.
ShiftRequired. Specifies the state of SHIFT, CTRL, and ALT.

Settings The settings for DragState are:

ConstantValueDescription
fmDragStateEnter0Mouse pointer is within range of a target.
fmDragStateLeave1Mouse pointer is outside the range of a target.
fmDragStateOver2Mouse pointer is at a new position, but remains within range of the same target.

The settings for Effect are:

ConstantValueDescription
fmDropEffectNone0Does not copy or move the drop source to the drop target.
fmDropEffectCopy1Copies the drop source to the drop target.
fmDropEffectMove2Moves the drop source to the drop target.
fmDropEffectCopyOrMove3Copies or moves the drop source to the drop target.

The settings for Shift are:

ConstantValueDescription
fmShiftMask1SHIFT was pressed.
fmCtrlMask2CTRL was pressed.
fmAltMask4ALT was pressed.

Remarks Use this event to monitor the mouse pointer as it enters, leaves, or rests directly over a valid target. When a drag-and-drop operation is in progress, the system initiates this event when the user moves the mouse, or presses or releases the mouse button or buttons. The mouse pointer position determines the target object that receives this event. You can determine the state of the mouse pointer by examining the DragState argument. When a control handles this event, you can use the Effect argument to identify the drag-and-drop action to perform. When Effect is set to fmDropEffectCopyOrMove, the drop source supports a copy ( fmDropEffectCopy ), move ( fmDropEffectMove ), or a cancel ( fmDropEffectNone ) operation. When Effect is set to fmDropEffectCopy, the drop source supports a copy or a cancel ( fmDropEffectNone ) operation. When Effect is set to fmDropEffectMove, the drop source supports a move or a cancel ( fmDropEffectNone ) operation. When Effect is set to fmDropEffectNone. the drop source supports a cancel operation. Most controls do not support drag-and-drop while Cancel is False, which is the default setting. This means the control rejects attempts to drag or drop anything on the control, and the control does not initiate the BeforeDropOrPaste event. The TextBox and ComboBox controls are exceptions to this; these controls support drag-and-drop operations even when Cancel is False.

© 2018 Microsoft