السحب و الإفلات
لتنفيذ السحب والإفلات عليك عمل التالي:
- قم بإعداد متحكمات Drop خصائص التي تقبل السحب والإفلات.
- إبدأ عملية السحب والإفلات بإستخدام Drag class. You usually do it in the MouseDrag event of the source control.
- Implement one of the Drag, DragMove or Drop event handlers on the controls that will be able to receive the drops.
The behaviour of the control that receives a drop is the following:
- If you don't implement the Drag event handler, nor the DragMove event handler, then:
- If the Drop event handler is implemented, then the drop is accepted.
- Otherwise, it is rejected.
- If you implement the Drag event handler, and if the event is stopped, then the drop is rejected and no DragMove event is raised.
- If you implement the DragMove event handler, and if the event is stopped, then the drop is rejected.