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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drag and Drop Selected Text 1

Status
Not open for further replies.

PascalTheroux

Programmer
Mar 1, 2002
6
CA
I want to program a Drag'n Drop between two text box. I found an example on MSDN but it drag all the text of the first textbox in the second one. I want to be able to select a part of the text and drag only the selected part in the second box. I tried to modify it but without success. Someone have an idea?

Thanks.

Pascal Theroux
 
Pascal,

The problem here is that SelectedText and DragDrop won't work together because the moment we click on a text box to drag selected item, it will loose the selected text property because naturally control assumes that click is to give focus to a control rather than initiating a drag process and unfortunatly textBox does not have a DragStart event. But what we can do is holding down the Shift key and select the text and then dragging it will work as expected.
 
Thanks for asking this Pascal.
And thanks for the answer Kris11.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top