Initiates an OLE drag & drop operation.
| C# | void object.OLEDrag(); |
| VB.NET | object.OLEDrag() |
| C++ | HRESULT object->OLEDrag(); |
| C | HRESULT object->raw_OLEDrag(); |
object
The OLEDrag method initiates an OLE drag & drop operation.
When the OLEDrag method is called, the OLEStartDrag event occurs, allowing the application to supply data to a target component.
An application can invoke an OLE drag & drop operation explicitly using the OLEDrag method.
If the OLEDragMode property is set to OLEDragSftBoxAutomatic, the OLEDrag method is automatically invoked when an OLE drag & drop operation is started by the user.
comboTarget.Items.Add("Another Source Item");
comboTarget.Items.Add("Last Source Item");
comboTarget.Columns.MakeOptimal(0);
comboTarget.Items.RecalcHorizontalExtent(0);
}
private void comboSource_DragStarting(object sender, AxSftBoxLib60._ISftBoxEvents_DragStartingEvent e)
{
comboSource.OLEDrag();
}
private void comboSource_OLEStartDrag(object sender, AxSftBoxLib60._ISftBoxEvents_OLEStartDragEvent e)
{
e.allowedEffects = vbDropEffectCopy | vbDropEffectMove;
string textData = comboSource.get_Cell(comboSource.Items.Selection, 0).Text;
e.data.SetData(textData, SftOLEClipboardConstants.sftCFText);
comboTarget.Items.Add("Another Source Item")
comboTarget.Items.Add("Last Source Item")
comboTarget.Columns.MakeOptimal(0)
comboTarget.Items.RecalcHorizontalExtent(0)
End Sub
Private Sub comboSource_DragStarting(ByVal sender As Object, ByVal e As AxSftBoxLib60._ISftBoxEvents_DragStartingEvent) Handles comboSource.DragStarting
comboSource.OLEDrag()
End Sub
Private Sub comboSource_OLEStartDrag(ByVal sender As Object, ByVal e As AxSftBoxLib60._ISftBoxEvents_OLEStartDragEvent) Handles comboSource.OLEStartDrag
e.allowedEffects = vbDropEffectCopy Or vbDropEffectMove
Dim textData As String = comboSource.get_Cell(comboSource.Items.Selection, 0).Text
e.data.SetData(textData, SftOLEClipboardConstants.sftCFText)
End SubSee Also SftBox Object | Object Hierarchy