1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| Private Sub LB1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles LB1.MouseDown
LB1.DoDragDrop(LB1.Text, DragDropEffects.Copy Or DragDropEffects.Move)
End Sub
Private Sub Grid2_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Grid2.DragEnter
If (e.Data.GetDataPresent(DataFormats.Text)) Then
e.Effect = DragDropEffects.Copy
Else
e.Effect = DragDropEffects.None
End If
End Sub
Private Sub Grid2_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Grid2.DragDrop
Grid2.Text = e.Data.GetData(DataFormats.Text).ToString
End Sub |
Partager