ToolStripItem.DoDragDrop(Object, DragDropEffects) 方法

定義

開始拖放作業。Begins a drag-and-drop operation.

public:
 System::Windows::Forms::DragDropEffects DoDragDrop(System::Object ^ data, System::Windows::Forms::DragDropEffects allowedEffects);
public System.Windows.Forms.DragDropEffects DoDragDrop (object data, System.Windows.Forms.DragDropEffects allowedEffects);
member this.DoDragDrop : obj * System.Windows.Forms.DragDropEffects -> System.Windows.Forms.DragDropEffects
Public Function DoDragDrop (data As Object, allowedEffects As DragDropEffects) As DragDropEffects

參數

data
Object

要拖曳的物件。The object to be dragged.

allowedEffects
DragDropEffects

可以發生的拖曳作業。The drag operations that can occur.

傳回

其中一個 DragDropEffects 值。One of the DragDropEffects values.

備註

如果拖曳作業需要與另一個進程中的應用程式互動,則 data 參數必須是基底 managed 類別(例如 System.StringSystem.Drawing.BitmapSystem.Drawing.Imaging.Metafile)、執行 System.Runtime.Serialization.ISerializable的物件,或是執行 IDataObject的物件。If the drag operation needs to interact with applications in another process, the data parameter must either be a base managed class (such as System.String, System.Drawing.Bitmap, or System.Drawing.Imaging.Metafile), an object that implements System.Runtime.Serialization.ISerializable, or an object that implements IDataObject.

適用於