Hi,
1. Set following property for Panel to True (if it was set to false)
"AllowDrop"
2. Then there are two events for which you that you should write event handler. One is DragEnter and DragDrop. (a) DragEnter decides whether data going to be draged is valid data and if valid data then (b)DragDrop accets the data dragged onto it.
Therefore eventhandler of DragEnter should be for checking data and in DragDrop you write your code to process data after it is accepted.
private void panel1_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.Copy;
else
e.Effect = DragDropEffects.None;
}
private void panel1_DragDrop(object sender, DragEventArgs e)
{
MessageBox.Show("XYZ file is drag-dropped to the panel");
}
Hope that helps you,