listBox中的项目不希望被拖出

时间:2011-11-14 20:08:14

标签: c# winforms listbox drag-and-drop

  

可能重复:
  How to make drag-and-drop from one list to another in C#/WindowsForms?

我试图制作2个listBoxes(使用WinForms),能够将表单拖放到另一个,但即使将listBoxes的属性'AllowDrop'设置为True,一个listBox中的项目也不需要被拖出它 - 光标没有改变,并且没有调用DragLeave,DragDrop等方法。

我错过了什么吗?

如果您想要我添加一些代码,请发表评论。

1 个答案:

答案 0 :(得分:0)

您必须在源列表框上调用DoDragDrop才能开始拖动操作。这通常是在响应某些标准事件(即鼠标点击)

时完成的