ToolStripItem.DoDragDrop 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| DoDragDrop(Object, DragDropEffects) |
开始拖放操作。 |
| DoDragDrop(Object, DragDropEffects, Bitmap, Point, Boolean) |
开始拖动操作。 |
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.String, System.Drawing.Bitmap或 System.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 应为基托管类(String或 Bitmap)或 Metafile实现的一些 Object 类 ISerializable。
data 也可以是实现的任何 Object 实现 IDataObject。
dragImage 是将在拖动操作期间显示的位图,并 cursorOffset 指定光标在内 dragImage的位置,这是与左上角的偏移量。 指定dragImage 。
由于 DoDragDrop(Object, DragDropEffects, Bitmap, Point, Boolean) 始终在计算 alpha 值时执行 RGB 乘法步骤,因此应始终传递不 Bitmap 带预乘 alpha 混合。 不会导致任何错误通过预乘 alpha 混合传递 Bitmap ,但此方法将再次相乘,使生成的 alpha 值加倍。