Question : How to get file path/name after drag drop.

I have a richtextbox and I'm dragging and dropping a file into it to open it.
I have some parsing code I want to run but I can't figure out how to get the file path into
public FILE_NAME.as string.

What would the code be for that?

Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
Private Sub RichTextBox1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles RichTextBox1.DragDrop
        If e.Data.GetDataPresent(DataFormats.FileDrop) Then
            'Dim fileNames() As String = e.Data.GetData(DataFormats.FileDrop)
' I need to get the file path/name into Form1.FILE_NAME so I can process it.
            Form1.FILE_NAME = e.Data.GetData(DataFormats.FileDrop).ToString
            'Form1.ProcessFileOpened()
        End If
    End Sub

Answer : How to get file path/name after drag drop.

Why did you comment out the "fileNames" line you already had in there?....

        If e.Data.GetDataPresent(DataFormats.FileDrop) Then
            Dim fileNames() As String = e.Data.GetData(DataFormats.FileDrop)
            Form1.FILE_NAME = fileNames(0)
            Form1.ProcessFileOpened()
        End If
Random Solutions  
 
programming4us programming4us