title: Drag and Drop a Folder from Windows Explorer to listBox in C#
body: <p>I succeeded in developing C# code for drag files from windows explorer to listBox.</p>
  
  <pre><code>    // Drag and Drop Files to Listbox
      private void listBox1_DragEnter(object sender, DragEventArgs e)
      {
          if (e.Data.GetDataPresent(DataFormats.FileDrop, false))
              e.Effect = DragDropEffects.All;
          else
              e.Effect = DragDropEffects.None;
      }
  
      private void listBox1_DragDrop(object sender, DragEventArgs e)
      {
          string[] files = (string[])e.Data.GetData(DataFormats.FileDrop, false);
          foreach (string fileName in files)
          {
             listBox1.Items.Add(fileName);  
          }
      }
  </code></pre>
  
  <p>If I drag a folder to the listBox, all the files which are inside the folder to be added to the listBox items.</p>
  
  <p>It would be very helpful to me if anybody can provide me the code snippet for the above task.</p>
  
  <p>Thanks in advance.</p>