event OLEStartDrag (Data as ExDataObject, AllowedEffects as Long)
Occurs when the OLEDrag method is called.

 TypeDescription 
   Data as ExDataObject An ExDataObject object containing formats that the source will provide and, optionally, the data for those formats. If no data is contained in the ExDataObject, it is provided when the control calls the GetData method. The programmer should provide the values for this parameter in this event. The SetData and Clear methods cannot be used here.  
   AllowedEffects as Long A long containing the effects that the source component supports. The possible values are listed in Settings. The programmer should provide the values for this parameter in this event  
The settings for AllowEffects are:

The source component should logically Or together the supported values and places the result in the AllowedEffects parameter. The target component can use this value to determine the appropriate action (and what the appropriate user feedback should be). You may wish to defer putting data into the ExDataObject object until the target component requests it. This allows the source component to save time.  If the user does not load any formats into the ExDataObject, then the drag/drop operation is canceled. Use exCFFiles and Files property to add files to the drag and drop data object.

The idea of drag and drop in exExplorerTree control is the same as in other controls. To start accepting drag and drop sources the exExplorerTree control should have the OLEDropMode to exOLEDropManual. Once that is is set, the exExplorerTree starts accepting any drag and drop sources. 

The first step is if you want to be able to drag items from your exExplorerTree control to other controls the idea is to handle the OLE_StartDrag event. The event passes an object ExDataObject (Data) as argument. The Data and AllowedEffects can be changed only in the OLEStartDrag event. The OLE_StartDrag event is fired when user is about to drag items from the control. The AllowedEffect parameter and SetData property must be set to continue drag and drop operation, else the drag and drop operation is not started. Use the FocusGroup property determines the group where the drag and drop operations beings. Use the FocusItem property to determine the item that has the focus  in the group. Use the CellCaption property to get the caption of the cell.


Send comments on this topic.
© 1999-2008 Exontrol Inc, Software. All rights reserved.