how Can i Drag By Mouse Images From any Folder At Windows To My application To ListView Or Image Control
Like What Happened With Winamp
another Question
Can i copy Image From Windows And At My application Press Paste Image Loaded To It's control
how Can i Drag By Mouse Images From any Folder At Windows To My application To ListView Or Image Control
Like What Happened With Winamp
another Question
Can i copy Image From Windows And At My application Press Paste Image Loaded To It's control
السلام عليكــم ورحمـة الله وبركاتــه ،،
بالنسبة للسؤال الأول
Public Class Form1
Private Sub Form1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Me.DragDrop
If e.Data.GetDataPresent("FileDrop") Then
Dim data() As String = e.Data.GetData("FileDrop")
For Each file As String In data
If IO.Path.GetExtension(file).ToLower = ".jpg" Then
Me.BackgroundImage = New Bitmap(file)
End If
Next
End If
End Sub
Private Sub Form1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Me.DragEnter
If e.Data.GetDataPresent("FileDrop") Then
e.Effect = DragDropEffects.Link
Else
e.Effect = DragDropEffects.None
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.AllowDrop = True
End Sub
End Classبالنسبة للسؤال الثانى
إذا كنت تقصد نسخ الصورة نفسها من داخل محرر للصور كالرسام مثلا
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Clipboard.ContainsImage Then Me.BackgroundImage = Clipboard.GetImage End If End Sub
وإن كنت تقصد نسخ ملف الصورة يمكنك أن تستخدم Clipboard.GetFileDropList وتتحقق من نوع الملف كما فعلنا فى عملية السحب والإفلات
إن قلت قال الله قال رسولـه همزوك همز المنكر المتعالي
أو قلت قد قال الصحابة والألـى تبعاً لهم بالقول والأعمال
أو قلت قـال الشافعي وأحمد و أبو حنيفة والإمام الغالي
صدوا عن وحي الإله ودينـه واحتالوا على حرام الله بالإحلال
يا أمةً لعبت بدين نبيها كتلاعب الصبيان في الأوحال
حاشا رسول الله يحكم بالهوى تلك إذاً حكومة الضلال
thx Ghost2010 You always Help me thx alot