반응형
private void MainForm_DragDrop(object sender, DragEventArgs e)
{
// transfer the filenames to a string array
// (yes, everything to the left of the "=" can be put in the
// foreach loop in place of "files", but this is easier to understand.)
if (e.Data.GetDataPresent(DataFormats.FileDrop, false) == true)
{
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
foreach (string item in files)
{
OpenFile(item);
}
}
}
private void MainForm_DragEnter(object sender, DragEventArgs e)
{
// make sure they're actually dropping files (not text or anything else)
if (e.Data.GetDataPresent(DataFormats.FileDrop, false) == true)
// allow them to continue
// (without this, the cursor stays a "NO" symbol
e.Effect = DragDropEffects.All;
}
'Programing > C# ' 카테고리의 다른 글
ColorComboBox 만들기 (0) | 2012.06.21 |
---|---|
Color이름으로 Color객체 얻어오기 (0) | 2012.06.21 |
ComboBox in ListView (ListView에서 ComboBox띄우기) (0) | 2012.06.14 |
Convert Base64 To Image (0) | 2012.06.07 |
Enum값을 PropertyGrid에 원하는 형태로 바꿔서 출력하는 방법 EnumConverter (0) | 2012.05.16 |