Question question on drag and drop

itms

Active member
Joined
Feb 21, 2018
Messages
33
Programming Experience
10+
Hi,
I have the following code, which works great, for moving a file from a folder to a control.
However, my manager want is to also work if he drags it from an email. any ideas on how I can add to this code to get it to work with an email as well.
Right now they have to drag it to the desktop and then drag it to the control.
Here is the current code that I am using:
in the control:

VB.NET:
Private Sub Form_ScansImageAcquisition_DragDrop(sender As System.Object, e As System.Windows.Forms.DragEventArgs) Handles Me.DragDrop
        Dim files() As String = e.Data.GetData(DataFormats.FileDrop)
        RadioButton_BrowseForFile.Checked = True
 SplitContainer2 = e.Data.GetData(DataFormats.Text)

        For Each _path In files
            _filename = _path
            PageDisplay(TwainScanning.GetRasterFromFile(_path))
        Next

    End Sub

In the drag enter section I have the following:
VB.NET:
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
            e.Effect = DragDropEffects.Copy
        End If


Thank you
 
You basically just need to determine what the DataFormats value(s) is when that email is dragged. I suggest that you read the following and post #3 in particular.

 

Latest posts

Back
Top