mark c

mark c

  • NA
  • 14
  • 48.5k

Help with Drag/Drop

Jan 21 2011 6:43 PM
   private void Form1_Load(object sender, EventArgs e)
{

listBox1.DragDrop += new DragEventHandler(listBox1_DragDrop);

}
  private void listBox1_DragDrop(object sender, DragEventArgs e)
{
string[] FileList = (string[])e.Data.GetData(DataFormats.FileDrop, false);
MessageBox.Show(FileList[0]);

}
How come two messageboxes are shown when I drag a file in?

Answers (3)