VSFlexGrid Control > VSFlexGrid Properties, Events, and Methods > VSFlexGrid Events > OLEDragDrop Event |
Fired when a source component is dropped onto a target component.
Private Sub VSFlexGrid_OLEDragDrop(Data As VSDataObject, Effect As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
The parameters for the OLEDragDrop event are described below:
Data As vsDataObject
An object containing formats that the source will provide and (possibly) the data for those formats. If no data is contained in the object, it is provided when the control calls the GetData method. The SetData and Clear methods cannot be used here.
Effect As Long
A long integer set by the target component identifying the action that has been performed (if any), thus allowing the source to take appropriate action if the component was moved (such as the source deleting the data). The possible values are:
Constant |
Value |
Description |
vbDropEffectNone |
0 |
Drop operation was cancelled. |
vbDropEffectCopy |
1 |
Drop results in a copy from the source to the target. The original data remains. |
vbDropEffectMove |
2 |
Drop moves the data from the source to the target. The original data should be deleted. |
Button As Integer
An integer which acts as a bit field corresponding to the state of a mouse button when it is depressed. The left button is bit 0 (vb Left Button), the right button is bit 1 (vb Right Button), and the middle button is bit 2 (vb Middle Button). These bits correspond to the values 1, 2, and 4, respectively. It indicates the state of the mouse buttons; some, all, or none of these three bits can be set, indicating that some, all, or none of the buttons are depressed.
Shift As Integer
An integer which acts as a bit field corresponding to the state of the SHIFT, CTRL, and ALT keys when they are depressed. The SHIFT key is bit 0, the CTRL key is bit 1, and the ALT key is bit 2. These bits correspond to the values 1 (vb Shift Mask), 2 (vb Ctrl Mask), and 4 (vb Alt Mask), respectively. The shift parameter indicates the state of these keys; some, all, or none of the bits can be set, indicating that some, all, or none of the keys are depressed. For example, if both the CTRL and ALT keys were depressed, the value of shift would be 6.
X, Y As Single
These parameters specify the current location of the mouse pointer, in twips.
For an example of implementing OLE drag and drop with the VSFlexGrid control, see the OLE Drag and Drop Demo.