title: How to implement the common "Drag and Drop" icon in WinForms
body: <p>I'm currently designing a simple WinForms UserControl in C# where a user can drag and drop an excel file onto a panel instead of browsing for the file. I have it technically working, but it's very crude. </p>
  
  <p>In short, my code currently looks like this for the DragEnter and DragDrop events on the panel (removed error handling):</p>
  
  <pre><code>    private void dragPanel_DragEnter(object sender, DragEventArgs e)
      {
          var filenames = (string[])e.Data.GetData(DataFormats.FileDrop, false);
          if (Path.GetExtension(filenames[0]) == ".xlsx") e.Effect = DragDropEffects.All;
          else e.Effect = DragDropEffects.None;
      }
  
      private void dragPanel_DragDrop(object sender, DragEventArgs e)
      {
          var filenames = (string[])e.Data.GetData(DataFormats.FileDrop, false);
          string filename = filenames[0];
          // Do stuff
      }
  </code></pre>
  
  <p>I'm trying to get the Excel icon to show up as I drag the file, but all I can get is this thing:
  <a href="https://i.stack.imgur.com/KHzLi.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KHzLi.png" alt="enter image description here"></a></p>
  
  <p>Anywhere I've looked online (mostly on this forum) has said I need to implement my own custom cursor if I want a specific icon to show up, but I honestly don't believe that. I took screenshots of multiple applications from different companies all using the exact same control (this is just a subset). Note that none of them are even cursors, the icons just follow the cursor:</p>
  
  <p><strong>Windows Explorer:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/pLgna.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pLgna.png" alt="enter image description here"></a></p>
  
  <p><strong>Google Chrome:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/43GUt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/43GUt.png" alt="enter image description here"></a></p>
  
  <p><strong>Adobe Acrobat:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/9H9Bu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9H9Bu.png" alt="enter image description here"></a></p>
  
  <p><strong>Microsoft Edge:</strong></p>
  
  <p>(Same icon, but DragDropEffects are likely set to None)</p>
  
  <p><a href="https://i.stack.imgur.com/7lmTW.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7lmTW.png" alt="enter image description here"></a></p>
  
  <p>So my conclusion is there must be a common windows control for this, but where is it? There's no way all of these companies just coincidentally built the exact same design and functionality!</p>
  
  <p>Any help would be appreciated!</p>
  
  <p>Bonus Question: Apparently in Windows 10 you're not allowed to drag-and-drop onto a program that's running as Administrator, however Chrome definitely lets you do this. You can run Chrome as Admin and drag a file onto it without any issue. What magic did Google use to bypass this security feature? I'd like to implement it as well as my control could potentially be used inside a program running as admin.</p>