Usually, this property is sufficent (short version):
namespace DiapoWin
{
partial class mainWindow
{
private void InitializeComponent()
{
this.AllowDrop = true;
AllowDrop is set to true for the main Form, and the ListBox (supposed to be the target of the drag/drop).
Here are my event handlers (from this post) :
private void listImages1_DragDrop(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
string[] fileNames = (string[])e.Data.GetData(DataFormats.FileDrop);
TextDelai.Lines = fileNames;
}
}
private void listImages1_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
e.Effect = DragDropEffects.Copy;
}
}
But I still receive the forbidden
mouse cursor when attempting to drop a folder (even with a file).
Any ideas?