ToolStripItem.DoDragDrop 方法

定义

重载

DoDragDrop(Object, DragDropEffects)

Source:
ToolStripItem.cs
Source:
ToolStripItem.cs
Source:
ToolStripItem.cs
Source:
ToolStripItem.cs
Source:
ToolStripItem.cs

开始拖放操作。

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

要拖动的对象。

allowedEffects
DragDropEffects

可能发生的拖动操作。

返回

其中一个 DragDropEffects 值。

注解

如果拖动操作需要与其他进程中的应用程序交互,则 data 参数必须是基托管类(例如 System.StringSystem.Drawing.BitmapSystem.Drawing.Imaging.Metafile)实现 System.Runtime.Serialization.ISerializable的对象,或者是实现 IDataObject的对象。

适用于

DoDragDrop(Object, DragDropEffects, Bitmap, Point, Boolean)

Source:
ToolStripItem.cs
Source:
ToolStripItem.cs
Source:
ToolStripItem.cs
Source:
ToolStripItem.cs
Source:
ToolStripItem.cs

开始拖动操作。

public:
 System::Windows::Forms::DragDropEffects DoDragDrop(System::Object ^ data, System::Windows::Forms::DragDropEffects allowedEffects, System::Drawing::Bitmap ^ dragImage, System::Drawing::Point cursorOffset, bool useDefaultDragImage);
public System.Windows.Forms.DragDropEffects DoDragDrop(object data, System.Windows.Forms.DragDropEffects allowedEffects, System.Drawing.Bitmap? dragImage, System.Drawing.Point cursorOffset, bool useDefaultDragImage);
public System.Windows.Forms.DragDropEffects DoDragDrop(object data, System.Windows.Forms.DragDropEffects allowedEffects, System.Drawing.Bitmap dragImage, System.Drawing.Point cursorOffset, bool useDefaultDragImage);
member this.DoDragDrop : obj * System.Windows.Forms.DragDropEffects * System.Drawing.Bitmap * System.Drawing.Point * bool -> System.Windows.Forms.DragDropEffects
Public Function DoDragDrop (data As Object, allowedEffects As DragDropEffects, dragImage As Bitmap, cursorOffset As Point, useDefaultDragImage As Boolean) As DragDropEffects

参数

data
Object
allowedEffects
DragDropEffects
dragImage
Bitmap
cursorOffset
Point
useDefaultDragImage
Boolean

返回

枚举中的 DragDropEffects 一个值,表示拖放操作期间执行的最终效果。

注解

allowedEffects 参数确定可以执行哪些拖动操作。 如果拖动操作需要与其他进程中的应用程序互操作, data 应为基托管类(StringBitmap)或 Metafile实现的一些 ObjectISerializabledata 也可以是实现的任何 Object 实现 IDataObjectdragImage 是将在拖动操作期间显示的位图,并 cursorOffset 指定光标在内 dragImage的位置,这是与左上角的偏移量。 指定使用大小为 96x96 的分层窗口拖动图像;否则为 < a0/>。 请注意,如果图像宽度或高度超过 300 像素,则混合外边缘 dragImage

由于 DoDragDrop(Object, DragDropEffects, Bitmap, Point, Boolean) 始终在计算 alpha 值时执行 RGB 乘法步骤,因此应始终传递不 Bitmap 带预乘 alpha 混合。 不会导致任何错误通过预乘 alpha 混合传递 Bitmap ,但此方法将再次相乘,使生成的 alpha 值加倍。

适用于