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 dropped on the control.
VB.NET | Private Sub object_OLEDragDrop(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.OLEDragDrop |
VB | Private Sub object_OLEDragDrop(Data As DataObject, TargetChar As Long, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single) |
C#.NET | void object_OLEDragDrop(object sender, EventArgumentType e); |
VC++ | void OnOLEDragDropobject(struct IVDMDataObject** Data, long* TargetChar, long* Effect, short* Button, short* Shift, float* x, float* y); |
C | HRESULT OnOLEDragDropobject(struct IVDMDataObject** Data, long* TargetChar, long* Effect, short* Button, short* Shift, float* x, float* y); |
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 and Clear methods cannot be used here.
TargetChar
Describes the insertion point where the data is to be inserted.
Effect
A Long variable 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).
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. Only one of the bits is set, indicating the button that caused the event.
Button | Value | Description |
---|---|---|
constSftMaskLeftButton | 1 | The left mouse button was pressed. |
constSftMaskRightButton | 2 | The middle mouse button was pressed. |
constSftMaskMiddleButton | 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 |
---|---|---|
constSftMaskShiftMask | 1 | The SHIFT key is down. |
constSftMaskCtrlMask | 2 | The CONTROL key is down. |
constSftMaskAltMask | 4 | The ALT key is down. |
x
The x coordinate of the mouse cursor. The units used depend on the container (Visual Basic, Visual C++, etc.) and the coordinate system used.
y
The y coordinate of the mouse cursor. The units used depend on the container (Visual Basic, Visual C++, etc.) and the coordinate system used.
The OLEDragDrop event occurs when an object is dropped on the control.
The OLEDragDrop event only occurs if the OLEDropMode property is set to OLEDropSftMaskManual.
The TargetChar argument can be used to determine the drop target within the control.
The source control should always mask values from the Effect parameter to insure compatibility with future implementations of OLE 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...
-or-
If (Effect And vbDropEffectCopy)...
This allows for the definition of new drop effects in future versions while preserving compatibility with existing code.
AxSftMask1.Caption.SizePercent = 33 AxSftMask1.Caption.Text = "&Filename:" AxSftMask1.Mask = "" AxSftMask1.MaxLength = 300 AxSftMask1.PromptUnderline = False AxSftMask1.OLEDropMode = SftMaskOLEDropModeConstants.OLEDropSftMaskManual End Sub Private Sub AxAxSftMask1_OLEDragDrop(ByVal sender As Object, ByVal e As AxSftMaskLib70._ISftMaskEvents_OLEDragDropEvent) Handles AxSftMask1.OLEDragDrop Dim S As String If e.data.GetFormat(SftOLEClipboardConstants.sftCFText) Then S = e.data.GetData(SftOLEClipboardConstants.sftCFText) AxSftMask1.SelStart = e.targetChar AxSftMask1.SelText = S Else e.effect = 0 ' vbDropEffectNone
SftMask1.Caption.SizePercent = 33 SftMask1.Caption.Text = "&Filename:" SftMask1.Mask = "" SftMask1.MaxLength = 300 SftMask1.PromptUnderline = False SftMask1.OLEDropMode = OLEDropSftMaskManual End Sub Private Sub SftMask1_OLEDragDrop(Data As SftMaskLib70.DataObject, TargetChar As Long, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single) Dim S As String If Data.GetFormat(sftCFText) Then S = Data.GetData(sftCFText) SftMask1.SelStart = TargetChar SftMask1.SelText = S Else Effect = vbDropEffectNone
axSftMask1.Caption.SizePercent = 33; axSftMask1.Caption.Text = "&Filename:"; axSftMask1.Mask = ""; axSftMask1.MaxLength = 300; axSftMask1.PromptUnderline = false; axSftMask1.OLEDropMode = SftMaskOLEDropModeConstants.OLEDropSftMaskManual; } private void axSftMask1_OLEDragDrop(object sender, AxSftMaskLib70._ISftMaskEvents_OLEDragDropEvent e) { string s; if (e.data.GetFormat((short) SftOLEClipboardConstants.sftCFText)) { s = (string) e.data.GetData(SftOLEClipboardConstants.sftCFText); axSftMask1.SelStart = e.targetChar; axSftMask1.SelText = s; } else {
m_pMask1->Mask = _T(""); m_pMask1->MaxLength = 300; m_pMask1->PromptUnderline = VARIANT_FALSE; m_pMask1->OLEDropMode = OLEDropSftMaskManual; return TRUE; } void CProject1Dlg::OnOLEDragDropSftMask1(LPDISPATCH FAR* Data, long FAR* TargetChar, long FAR* Effect, short FAR* Button, short FAR* Shift, float FAR* x, float FAR* y) { IVDMDataObjectPtr pData = *Data; if (pData->GetFormat(sftCFText) != VARIANT_FALSE) { _variant_t data = pData->GetData(_variant_t((long) sftCFText)); data.ChangeType(VT_BSTR); m_pMask1->SelStart = *TargetChar;
See Also SftMask Events | Object Hierarchy