Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

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

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

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

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?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close