to 任远:
很抱歉,拖放操作我还没有真正玩过,但有一点可以肯定的是,拖放操作的数据源
和目的地都应该支持拖放消息才行.
你可以先从简单一点的开始,但我从delphi自身帮助文件中看到以下说明,请注意
后面的备注,即Notes:
Occurs when the user begins to drag the control or an object it contains by left-clicking on the control and holding the mouse button down.
type TStartDragEvent = procedure (Sender: TObject; var DragObject: TDragObject) of object;
property OnStartDrag: TStartDragEvent;
Description
Use the OnStartDrag event handler to implement special processing when the user starts to drag the control or an object it contains. OnStartDrag only occurs if DragKind is dkDrag.
Sender is the control that is about to be dragged, or that contains the object about to be dragged.
The OnStartDrag event handler can create a TDragControlObjectEx instance for the DragObject parameter to specify the drag cursor, or, optionally, a drag image list. If you create a TDragControlObjectEx instance, there is no need to call the Free method for the DragObject when dragging is over. If you create, instead, a TDragControlObject instance, your application is responsible for freeing the drag object instance.
If the OnStartDrag event handler sets the DragObject parameter to nil, a TDragControlObject object is automatically created and dragging begins on the control itself.
Note: On some controls, such as TRichEdit, the underlying Windows control handles internal drag operations. For these controls, there are no OnStartDrag or OnEndDrag events for drag operations within the control.