SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
An object is dragged over the 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, Folder As SftDirectoryFolder, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single, State As SftControlOLEDragOverConstants, DefaultHandling As Boolean) |
C#.NET | void object_OLEDragOver(object sender, EventArgumentType e); |
VC++ | void OnOLEDragOverobject(struct IVDMDataObject** Data, ISftDirectoryFolder** Folder, long* Effect, short* Button, short* Shift, float* x, float* y, enum SftControlOLEDragOverConstants* State, VARIANT_BOOL* DefaultHandling); |
C | HRESULT OnOLEDragOverobject(struct IVDMDataObject** Data, ISftDirectoryFolder** Folder, long* Effect, short* Button, short* Shift, float* x, float* y, enum SftControlOLEDragOverConstants* State, VARIANT_BOOL* DefaultHandling); |
object
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. The SetData method and Clear methods cannot be used here.
Folder
Describes the target folder where the data is potentially about to be dropped. Folder may be Nothing (NULL), in which case the data is dropped on the control, not on a particular folder. Folder can be Nothing (NULL) only if the ControlStyle property is set to styleSftDirectoryDetailList or styleSftDirectoryComboBoxDetailList.
Effect
A Long variable 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.
Effect | 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 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.
Button
Describes the button(s) that are pressed. 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. The bits set indicate the button that caused the event.
Button | Value | Description |
---|---|---|
constSftControlLeftButton | 1 | The left mouse button was pressed. |
constSftControlRightButton | 2 | The middle mouse button was pressed. |
constSftControlMiddleButton | 4 | The right mouse button was pressed. |
Shift
Describes the state of the SHIFT, CONTROL and ALT keys. 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. It indicates the state of these keys. Some, all, or none of the bits can be set, indicating which of the keys are pressed.
Shift | Value | Description |
---|---|---|
constSftControlShiftMask | 1 | The SHIFT key is down. |
constSftControlCtrlMask | 2 | The CONTROL key is down. |
constSftControlAltMask | 4 | The ALT key is down. |
xPos
The x coordinate of the mouse cursor. The units used depend on the container (Visual Basic, Visual C++, etc.) and the coordinate system used.
yPos
The y coordinate of the mouse cursor. The units used depend on the container (Visual Basic, Visual C++, etc.) and the coordinate system used.
State
Defines the transition state of the data being dragged in relation to the target control.
State | Value | Description |
---|---|---|
enterSftControl | 0 | Source component is being dragged within the range of a target. |
leaveSftControl | 1 | Source component is being dragged out of the range of a target. |
overSftControl | 2 | Source component has moved from one position in the target to another. |
DefaultHandling
On return, determines how the data is processed.
DefaultHandling | Description |
---|---|
True | The control's default handling for the event takes place. |
False | The application has completely processed the event and no further action by the control is desired. |
The OLEDragOver event occurs when an object is dragged over the control.
MessageBox.Show("""" & e.data.Files(I) & """ being dropped.") ' perform your own processing here Next Else ' some other format End If End Sub Private Sub AxSftDirectory1_OLEDragOver(ByVal sender As Object, ByVal e As AxSftDirectoryLib30._ISftDirectoryEvents_OLEDragOverEvent) Handles AxSftDirectory1.OLEDragOver ' make sure the control doesn't perform its usual default handling of ' the files (copy/move, etc.) e.defaultHandling = False e.effect = 0 If e.data.GetFormat(SftOLEClipboardConstants.sftCFFiles) Then If Not e.folder Is Nothing Then
Else ' some other format End If ' make sure the control doesn't perform its usual default handling of ' the files (copy/move, etc.) DefaultHandling = False End Sub Private Sub SftDirectory1_OLEDragOver(Data As SftDirectoryLib30.DataObject, _ Folder As SftDirectoryLib30.ISftDirectoryFolder, Effect As Long, _ Button As Integer, Shift As Integer, x As Single, y As Single, _ State As SftDirectoryLib30.SftControlOLEDragOverConstants, _ DefaultHandling As Boolean) Effect = 0 If Data.GetFormat(sftCFFiles) Then If Not Folder Is Nothing Then
MessageBox.Show("\"" + e.data.Files[i+1] + "\" being dropped."); // perform your own processing here } } else { // some other format } } private void axSftDirectory1_OLEDragOver(object sender, AxSftDirectoryLib30._ISftDirectoryEvents_OLEDragOverEvent e) { // make sure the control doesn't perform its usual default handling of // the files (copy/move, etc.) e.defaultHandling = false; e.effect = 0; if (e.data.GetFormat((short) SftOLEClipboardConstants.sftCFFiles)) {
} else { // some other format } // make sure the control doesn't perform its usual default handling of // the files (copy/move, etc.) *DefaultHandling = VARIANT_FALSE; } void COLEDragDlg::OnOLEDragOverSftDirectory1(LPDISPATCH FAR* Data, LPDISPATCH FAR* Folder, long FAR* Effect, short FAR* Button, short FAR* Shift, float FAR* x, float FAR* y, long FAR* State, BOOL FAR* DefaultHandling) { IVDMDataObjectPtr pData(*Data); ISftDirectoryFolderPtr pFolder(*Folder); *Effect = 0; if (pData->GetFormat(sftCFFiles)) { if (pFolder != NULL) {
See Also SftDirectory Object | Object Hierarchy