منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
[مثال] السحب والاسقاط من اداة picturebox الى مجلد مفتوح - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182)
+--- قسم : قسم مقالات VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=184)
+--- الموضوع : [مثال] السحب والاسقاط من اداة picturebox الى مجلد مفتوح (/showthread.php?tid=12350)



السحب والاسقاط من اداة picturebox الى مجلد مفتوح - الطالب - 23-05-15

سلام

السحب والاسقاط من اداة picturebox الى مجلد مفتوح مباشرة windows explorer.

هذا مثال لطريقة سحب صورة من اداة الصور picturebox الى اي مجلد مفتوح explorer.

كود :
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

   PictureBox1.AllowDrop = True

End Sub

Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
   If (e.Button = MouseButtons.Left) Then
       Dim filename As String = IO.Path.GetTempPath & "\" & "image.jpg"
       PictureBox1.Image.Save(filename, Imaging.ImageFormat.Jpeg)
       DoDragDrop(New DataObject(DataFormats.FileDrop, New String() {filename}), DragDropEffects.Move)
   End If
End Sub

Private Sub PictureBox1_DragEnter(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles PictureBox1.DragEnter
   e.Effect = e.AllowedEffect
End Sub

في المرفقات مشروع جاهز

موفقين