Programming with C#/C# 프로그래밍

[C# 프로그래밍] Drag and Drop

laboputer 2016. 1. 31. 00:00

private void Form1_DragDrop(object sender, DragEventArgs e)

{

if (e.Data.GetDataPresent(DataFormats.FileDrop))

{

string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);

foreach (string filePath in files)

{

MessageBox.Show(filePath);

}

}

}


private void Form1_DragEnter(object sender, DragEventArgs e)

{

e.Effect = DragDropEffects.All;

}