|
-
August 19th, 2003, 01:37 PM
#1
Drag and Drop
Does anyone know how to drag and drop like Windows explorer does? I can do drag and dropping of filenames using:
Data.Files.Add (location of file)
Data.SetData , vbCFFILes
But I want to get more in depth and do it like Windows Explorer. The source I am dropping too acts differently if the file is dragged and dropped like a windows explorer file. Thank you for your time.
-
August 19th, 2003, 02:47 PM
#2
Here's an example using a textbox where user has highlighted a certain portion of the textbox for dragging:
On the Text1 control's Mouse Up event:
Code:
If Text1.SelStart > 0 Then
Text1.DragIcon = LoadPicture("path of whatever icon you want to use")
Text1.Drag vbBeginDrag
End If
On the receiving control's DragDrop event, let's call it Text2:
Code:
' Copy your info here
Text2.Text = Text1.SelText
Text2.Drag vbEndDrag
Text2.DragIcon = Nothing
-
August 21st, 2003, 10:45 AM
#3
Thank you for the help, but I don't want to physically move things. I am looking for some OLEDrag implementation.
I do the above mentioned code and I drag and drop the file fine into another application. But, the file I drag and drop acts differently under OLEDrag operation then it does in Windows Explorer. Does anyone have any ideas about this.
THank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|