Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cancel Drag and Drop if Origin and Destination are the same?

Status
Not open for further replies.

Amesville

Programmer
Oct 10, 2011
93
0
0
US
OK Here's another one I'm stumped on...

My app supports drag and drop. Part of the logic is that when a text value is dragged from one textbox to another, the originating textbox is supposed to have it's color changed to gray. If it does, it cannot be used for drag and drop again. This is working fine.

My problem is that sometimes a user may double-click slowly in the same text box, and this has the effect of performing the drag and drop into the same textbox. This colors the textbox gray, and now the user can't use that box for drag and drop again even though the process was unintended.

I can probably set up a left-click context menu allowing the user to right-click on the textbox and reset it, but I'd prefer to automatically cancel the operation if the origin and destination of the DragDrop is the same. Should be simple enough to create an IF statement that checks to see if the origin and destination values are the same. But in the DragDrop event there does not seem to be a way to identify the destination control, only the origin. Can anyone suggest a way to help make this happen?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top