#693 – TextBox Control Supports Drag-and-Drop

The TextBox control in WPF automatically supports drag-and-drop, in several different scenarios.

You can select text in one TextBox and drag it into another.  If you just click the left mouse button on some selected text and drag, the text will be cut from the first TextBox and pasted into the second.

 

If you hold the Ctrl key down while clicking and dragging, you can do a copy operation.

 

You can also drag text from another application (e.g. a web browser) into a TextBox in your application.

 

And you can drag text from a TextBox out of your application, into an application that accepts text as the result of a drag operation.

 

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

3 Responses to #693 – TextBox Control Supports Drag-and-Drop

  1. Pingback: Dew Drop – November 19, 2012 (#1,445) | Alvin Ashcraft's Morning Dew

  2. I am working on a W.P.F application that has a Form with multiple text boxes which require similar effect.I have tried several times but could not accomplish the task. It will be helpful for me if you share the code for the case involving three windows from the top.

Leave a comment