المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Temporary Modification in a Control During Drag and Drop



C# Programming
02-20-2010, 07:13 PM
There are a some rectangular controls on a winform on which a dragdrop can happen.

When an item (which has a numeric value) is dragged over any of these controls, the control should show possible result by changing its shape (Increase area by numeric value).

This should be temporary. In case i move the item it out of the control without dropping, this change should revert back. Only in case the drop is done, the change should be permanent.

Now, this effect can be achieved using DragEnter and DragLeave. Currently, I am making the modification to the Control two times by adding the changes and removing the changes.

What I want to know now is whether it is possible to save the state of control so that it can be reverted back to the old state.

In reality, the changes are complicated than just adding area into the shape. But the concept remains same. Control needs to change temporarily and a simple method to restore its state needs to be achieved.

Is it possible?