السحب و الإفلات

لتنفيذ السحب والإفلات عليك عمل التالي:
  • قم بإعداد متحكمات Drop خصائص التي تقبل السحب والإفلات.

  • إبدأ عملية السحب والإفلات بإستخدام Drag class. You usually do it in the MouseDrag of the source control.

  • Implement one of the Drag, DragMove or Drop handlers on the controls that will be able to receive the drops.

The behaviour of the control that receives a drop is the following:
  1. If you don't implement the Drag handler, nor the DragMove handler, then:
    • If the Drop handler is implemented, then the drop is accepted.

    • Otherwise, it is rejected.

  2. If you implement the Drag handler, and if the is stopped, then the drop is rejected and no DragMove is raised.

  3. If you implement the DragMove handler, and if the is stopped, then the drop is rejected.