Click to See Complete Forum and Search --> : Drag and drop


Bezzie
October 20th, 2001, 03:26 AM
Hi All

I've got textboxes on the form in the shape of a family tree. How do I get drag and drop to work in the following manner: I want to select the text in one of the textboxes and drag it to another textbox where it must replace the text thats already in the textbox.

I tried it but can only get the text to be dropped inserted in the textbox at the cursor position. The text in the drop textbox must be replaced with the text to be dropped.

Thanx

Bezzie

John G Duffy
October 20th, 2001, 12:55 PM
Set the OLEDropMode to manual then put this code into the OLEDragDrop event

private Sub Text2_OLEDragDrop(Data as DataObject, Effect as Long, Button as Integer, Shift as Integer, X as Single, Y as Single)
Dim temp as string
temp = Text2.Text
Text2.Text = Data.GetData(1)
End Sub




John G