Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load PictureBox1.AllowDrop = True PictureBox1.Top = 0 PictureBox1.Left = 0 PictureBox1.Width = Me.Width PictureBox1.Height = Me.Height
End Sub
Private Sub PictureBox1_DragEnter(ByVal sender As Object, _ ByVal e As System.Windows.Forms.DragEventArgs) _ Handles PictureBox1.DragEnter '関連連づけの確認をしています。 'この場合、ドラッグアンドドロップの形式であるかどうか? If e.Data.GetDataPresent(DataFormats.FileDrop) Then
'ドロップ効果を取得 e.Effect = DragDropEffects.Copy Else 'ドロップ効果を破棄 e.Effect = DragDropEffects.None End If
End Sub
Private Sub PictureBox1_DragDrop(ByVal sender As Object, _ ByVal e As System.Windows.Forms.DragEventArgs) _ Handles PictureBox1.DragDrop