Skip to content

OLEStartDrag Event

Description

Occurs when a component's OLEDrag method is performed, or when a component initiates an OLE drag/drop operation when the OLEDragMode property is set to Automatic.

Syntax

Public Event OLEStartDrag( _
    ByVal Data As DataObject, _
    ByRef AllowedEffects As Long _
)

Parameters

  • Data
    A DataObject object containing formats that the source will provide and, in addition, possibly the data for those formats. If no data is contained in the DataObject, it is provided when the control calls the GetData method.

  • AllowedEffects
    A long integer containing the effects that the source component supports. The possible values are listed below.

AllowedEffects Settings

Constant Value Description
vbDropEffectNone 0 Drop target cannot accept the data.
vbDropEffectCopy 1 Drop results in a copy of data from the source to the target. The original data is unaltered by the drag operation.
vbDropEffectMove 2 Drop results in data being moved from drag source to drop source. The drag source should remove the data from itself after the move.

Remarks

The StartDrag event also occurs if the component's OLEDragMode property is set to Automatic. This allows you to add formats and data to the DataObject object after the component has done so. You can also override the default behavior of the component by clearing the DataObject object (using the Clear method) and then adding your data and formats.

See Also

ListBox Control


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.