16-04-21, 02:49 AM
(16-04-21, 12:01 AM)asmarsou كتب :(15-04-21, 01:15 AM)sayyad كتب : أريد المساعدة : كيف أنقل صورة من مجلد إلى أداة picture box بواسطة السحب والافلات
مشكورين أصدقائي..
تفضل اخي الكريم
كود :
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
PictureBox1.AllowDrop = True
End Sub
Private Sub PictureBox1_DragDrop(ByVal sender As Object, ByVal e As DragEventArgs) Handles PictureBox1.DragDrop
Dim strDragDrop As String() = CType(e.Data.GetData(DataFormats.FileDrop), String())
For Each fileneve As String In strDragDrop
PictureBox1.ImageLocation = fileneve
Next
End Sub
Private Sub PictureBox1_DragEnter(ByVal sender As Object, ByVal e As DragEventArgs) Handles PictureBox1.DragEnter
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
e.Effect = DragDropEffects.Copy
End If
End Sub
End Class
ما شاء الله
ممتاز بارك الله فيك
