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
The beginning of a drag & drop operation has been detected.
VB.NET | Private Sub object_DragStarting(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.DragStarting |
VB | Private Sub object_DragStarting(ByVal Button As Integer, ByVal Shift As Integer, ByVal xPos As OLE_XPOS_PIXELS, ByVal yPos As OLE_YPOS_PIXELS) |
C#.NET | void object_DragStarting(object sender, EventArgumentType e); |
VC++ | void OnDragStartingobject(short Button, short Shift, OLE_XPOS_PIXELS xPos, OLE_YPOS_PIXELS yPos); |
C | HRESULT OnDragStartingobject(short Button, short Shift, OLE_XPOS_PIXELS xPos, OLE_YPOS_PIXELS yPos); |
object
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 in pixels where the mouse cursor is located.
yPos
The y coordinate in pixels where the mouse cursor is located.
The DragStarting event occurs when the beginning of a drag & drop operation has been detected.
The DragStarting event only occurs when the OLEDragMode property is set to OLEDragSftControlManual. An application can implement its own drag & drop processing or use the OLEDrag method in response to this event.
The CurrentFolder property can be used to determine where the drag & drop item starts. It typically includes all selected folders, which can be retrieved using the Selection property and the SelectionCount property.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AxSftDirectory1.OLEDragMode = SftControlOLEDragModeConstants.OLEDragSftControlManual End Sub Private Sub AxSftDirectory1_DragStarting(ByVal sender As Object, ByVal e As AxSftDirectoryLib30._ISftDirectoryEvents_DragStartingEvent) Handles AxSftDirectory1.DragStarting Dim F As SftDirectoryFolder F = AxSftDirectory1.CurrentFolder If Not F Is Nothing Then AxSftDirectory1.OLEDrag(False, True, -1, -1) End If End Sub Private Sub AxSftDirectory1_OLEStartDrag(ByVal sender As Object, ByVal e As AxSftDirectoryLib30._ISftDirectoryEvents_OLEStartDragEvent) Handles AxSftDirectory1.OLEStartDrag e.data.Clear() e.data.SetData(Nothing, SftOLEClipboardConstants.sftCFText) e.allowedEffects = 1 'vbDropEffectCopy
Private Sub Form_Load() SftDirectory1.OLEDragMode = OLEDragSftControlManual End Sub Private Sub SftDirectory1_DragStarting(ByVal Button As Integer, ByVal Shift As Integer, _ ByVal xPos As Single, ByVal yPos As Single) Dim F As SftDirectoryFolder Set F = SftDirectory1.CurrentFolder If Not F Is Nothing Then SftDirectory1.OLEDrag False, True, -1, -1 End If End Sub Private Sub SftDirectory1_OLEStartDrag(Data As SftDirectoryLib30.DataObject, _ AllowedEffects As Long) Data.Clear
private void Form1_Load(object sender, System.EventArgs e) { axSftDirectory1.OLEDragMode = SftControlOLEDragModeConstants.OLEDragSftControlManual; } private void axSftDirectory1_DragStarting(object sender, AxSftDirectoryLib30._ISftDirectoryEvents_DragStartingEvent e) { SftDirectoryFolder f; f = axSftDirectory1.CurrentFolder; if (f != null) { axSftDirectory1.OLEDrag(false, true, -1, -1); } } private void axSftDirectory1_OLEStartDrag(object sender, AxSftDirectoryLib30._ISftDirectoryEvents_OLEStartDragEvent e) {
HCURSOR COLEDragDlg::OnQueryDragIcon() { return (HCURSOR) m_hIcon; } BEGIN_EVENTSINK_MAP(COLEDragDlg, CDialog) //{{AFX_EVENTSINK_MAP(COLEDragDlg) ON_EVENT(COLEDragDlg, IDC_SFTDIRECTORY1, 4 /* DragStarting */, OnDragStartingSftDirectory1, VTS_I2 VTS_I2 VTS_I4 VTS_I4) ON_EVENT(COLEDragDlg, IDC_SFTDIRECTORY1, 35 /* OLEStartDrag */, OnOLEStartDragSftDirectory1, VTS_PDISPATCH VTS_PI4) ON_EVENT(COLEDragDlg, IDC_SFTDIRECTORY1, 34 /* OLESetData */, OnOLESetDataSftDirectory1, VTS_PDISPATCH VTS_PI2) //}}AFX_EVENTSINK_MAP END_EVENTSINK_MAP() BOOL COLEDragDlg::OnInitDialog() { CDialog::OnInitDialog();
See Also SftDirectory Object | Object Hierarchy