OLEDragOver Event, SftTree Object
An OLE drag & drop event indicating something is being dragged over the tree control.
|VB.NET||Private Sub object_OLEDragOver(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.OLEDragOver|
|VB||Private Sub object_OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single, State As Integer)|
|C#.NET||void object_OLEDragOver(object sender, EventArgumentType e);|
|VC++||void OnOLEDragOverobject(struct IVDMDataObject** Data, long* Effect, short* Button, short* Shift, float* x, float* y, short* State);|
|C||HRESULT OnOLEDragOverobject(struct IVDMDataObject** Data, long* Effect, short* Button, short* Shift, float* x, float* y, short* State);|
A SftTree object.
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 DataObject.GetData method. The DataObject.SetData and DataObject.Clear methods cannot be used here.
Set by the source object identifying all effects it supports. This parameter must be correctly set by the target component during this event. The value of Effect is determined by logically Or'ing together all active effects. The target component should check these effects and other parameters to determine which actions are appropriate for it, and then set this parameter to one of the allowable effects (as specified by the source) to specify which actions will be performed if the user drops the selection on the component.
|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 the drag source to the drop source. The drag source should remove the data from itself after the move.|
Note: Only Visual Basic offers the predefined constants vbDropEffectNone, etc. When using other languages, the constants have to be defined explicitly by the application.
An Integer variable describing the button that is pressed during the event (see SftTreeButtonConstants). The button argument is a bit field with bits corresponding to the left button, right button and middle button. These bits correspond to the values shown below. Only one of the bits is set, indicating the button that caused the event.
|constSftTreeLeftButton||1||The left mouse button was pressed.|
|constSftTreeRightButton||2||The right mouse button was pressed.|
|constSftTreeMiddleButton||4||The middle mouse button was pressed.|
The state of the SHIFT, CONTROL and ALT keys during the event (see SftTreeKeyConstants). A bit is set if the key is down. The Shift argument is a bit field with bits corresponding to the SHIFT, CONTROL and ALT keys. The Shift variable indicates the state of these keys. Some, all, or none of the bits can be set, indicating which of the keys are pressed.
|constSftTreeShiftMask||1||The SHIFT key was pressed.|
|constSftTreeCtrlMask||2||The CONTROL key was pressed.|
|constSftTreeAltMask||4||The ALT key was pressed.|
The x coordinate of the mouse cursor.
The y coordinate of the mouse cursor.
The transition state of the control being dragged in relation to the target control.
|vbEnter||0||Source component is being dragged within the range of a target.|
|vbLeave||1||Source component is being dragged out of the range of a target.|
|vbOver||2||Source component has moved from one position in the target to another.|
Note: Only Visual Basic offers the predefined constants vbEnter, etc. When using other languages, the constants have to be defined explicitly by the application.
The OLEDragOver event occurs indicating something is being dragged over the tree control.
The OLEDragOver event only occurs if the OLEDropMode property is set to OLEDropSftTreeManual.
The source control should always mask values from the Effect parameter to ensure compatibility with future implementations of drag & drop. Presently, only three bits in the Effect parameter are used. In future versions other bits may be used. As a precaution against future problems, drag sources and drop targets should mask these values appropriately before performing any comparisons.
For example, a source component should not compare an Effect against, for example, vbDropEffectCopy, such as:
If Effect = vbDropEffectCopy...
Instead, the source component should mask the value or values being sought, as here:
If Effect And vbDropEffectCopy = vbDropEffectCopy...
If (Effect And vbDropEffectCopy)...
This allows for the definition of new drop effects in future versions while preserving compatibility with your existing code.
See Also SftTree Object | Object Hierarchy