DragDropBlock, ScriptDragDropBlock Events
Applies To
fpSpread control
Description
Occurs when the user drags and drops a block of cells to a new location.
Syntax
afx_msg void OnDragDropBlockfpSpread(UINT, int, CWnd*, LPVOID);
Sub fpSpread_DragDropBlock(ByVal Col As Long, ByVal Row As Long, ByVal Col2 As Long, ByVal Row2 As Long, ByVal NewCol As Long, ByVal NewRow As Long, ByValNewCol2 As Long, ByVal NewRow2 As Long, ByVal Overwrite As Boolean, Action As Integer, DataOnly As Boolean, Cancel As Boolean)
Note: The ScriptDragDropBlock event uses the same syntax except event parameters that are not passed "ByVal" are declared as variants. For more information on Script events, see Scripting Environment Usage. |
Parameters
The following parameters are available:
Parameter | Description |
---|---|
Col | Column number of leftmost column in block |
Row | Row number of top row in block |
Col2 | Column number of rightmost column in block |
Row2 | Row number of bottom row in block |
NewCol | Column number of leftmost column in destination block |
NewRow | Row number of top row in destination block |
NewCol2 | Column number of rightmost column in destination block |
NewRow2 | Row number of bottom row in destination block |
Overwrite | Value is nonzero if destination block contains data |
Action | Value is 0 if the block is being moved or 1 if the block is being copied |
DataOnly | Set this value to True to copy or move only data before exiting the event |
Cancel | Set this value to True to cancel the drag-and-drop operation before exiting the event |
Remarks
The user can only perform drag-and-drop operations when the AllowDragDrop property is set to True.
As indicated in the parameter table, the event procedure can set the Action, DataOnly, and Cancel parameters. By default, the fpSpread control moves data and cell attributes in a drag-and-drop operation. You can change the value of the Action parameter to force a copy operation. Change the value of the DataOnly parameter to copy or move only data. Use the Cancel parameter to cancel the operation.
Use the SheetSendingEvent property if you want to return the sheet for which this event occured.
Note: This event will occur if you use the fpSpread control in a scripting environment (for example, Microsoft's Visual InterDev or Internet Explorer) or a non-scripting environment. However, if you want to use the fpSpread control in a scripting environment and you want to change any parameter that is not passed "ByVal", you must set the ScriptEnhanced property to True and use the ScriptDragDropBlock event. ScriptDragDropBlock event parameters that are not passed "ByVal" are declared as variants. |
See Also
Allowing Users to Drag and Drop Cells
AllowDragDrop, ScriptEnhanced, SheetSendingEvent properties