By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,640 Members | 1,331 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,640 IT Pros & Developers. It's quick & easy.

Drag & Drop File

P: n/a
Is it possible to drop a file from the VB.Net Application to the "Desktop"
or somewhere and start the copy file action? (I already know how to drop in
the application, but no idea how to drop out)
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Cor
Hi Mike,

I never tried it, but I think just write it to the desktop, the folder
browser is included in the code but that you can delete I think.

I hope this helps?

Cor
\\\
'Copy with windows explore some files and than this
Private Sub Button1_Click(ByVal sender _
As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim folderbrowserDialog1 As New FolderBrowserDialog
Dim iData As IDataObject = Clipboard.GetDataObject()
If iData.GetDataPresent(DataFormats.FileDrop) Then
Dim clipbrd As String() = DirectCast(iData.GetData(DataFormats.FileDrop),
String())
Dim i As Integer
folderbrowserDialog1.ShowDialog()
For i = 0 To clipbrd.Length - 1
If System.IO.File.Exists(folderbrowserDialog1.Selecte dPath _
& System.IO.Path.GetFileName(clipbrd(i))) Then
System.IO.File.Move(folderbrowserDialog1.SelectedP ath & _
"\" & _
System.IO.Path.GetFileName(clipbrd(i)), _
folderbrowserDialog1.SelectedPath & "temptemptemp.temp")
End If
System.IO.File.Copy(clipbrd(i), folderbrowserDialog1.SelectedPath & _
"\" & _
System.IO.Path.GetFileName(clipbrd(i)))
If System.IO.File.Exists(folderbrowserDialog1.Selecte dPath _
& "temptemptemp.temp") Then
System.IO.File.Delete(folderbrowserDialog1.Selecte dPath & _
"temptemptemp.temp")
End If
///
Is it possible to drop a file from the VB.Net Application to the "Desktop"
or somewhere and start the copy file action? (I already know how to drop in the application, but no idea how to drop out)

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.