How to modify dragged data during drag?

Xster

Member
Joined
May 15, 2007
Messages
11
Programming Experience
1-3
Hi,

I'm currently having the problem that dropping an image file into an AxWebBrowser causes it to navigate to the file location instead of pasting the image in the document while in EditMode.

So my thoughts are to swap the dragged data object when it DragEnters the form, before reaching the AxWebBrowser but it doesn't seem to work

VB.NET:
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
     Dim filenames As String() = CType(e.Data.GetData(DataFormats.FileDrop), String())
     If filenames.Length = 1 Then
         Dim picture As Image = Image.FromFile(filenames(0))
         e.Data.SetData(GetType(Image), picture)
     End If
End If

This is what I'm currently doing, of course it doesn't make sure that dragged file is an image but it's just for testing. But it doesn't seem to affect the IDataObject content of the drag. After e.Data.SetData(gettype(image),picture), e.Data.GetFormats still give FileDrop instead of Image...

Is there a way to clear the data being dragged and set it to something else?
 

Latest posts

Back
Top