Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Problem with FileDrop

Problem with FileDrop

Scheduled Pinned Locked Moved C#
csharpwinformshelptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Libor Tinka
    wrote on last edited by
    #1

    How to implement Drag&Drop capability of a WinForms application, when we want user to be able to drag and drop files and directories outside the main form through FileDrop? Dragging files from e.g. Windows Explorer to WinForms app is not a problem. But the reverse way is a big problem for me.

    B 1 Reply Last reply
    0
    • L Libor Tinka

      How to implement Drag&Drop capability of a WinForms application, when we want user to be able to drag and drop files and directories outside the main form through FileDrop? Dragging files from e.g. Windows Explorer to WinForms app is not a problem. But the reverse way is a big problem for me.

      B Offline
      B Offline
      benjymous
      wrote on last edited by
      #2

      You need to do something like this:

      string[] aFiles = ** filenames of that you want to drag out **;

      DoDragDrop(new DataObject(DataFormats.FileDrop, aFiles), DragDropEffects.Copy | DragDropEffects.Move);

      If the files you want to drag out aren't actually real files, the easiest solution is probably to create temporary files, and provide those filenames.

      -- Help me! I'm turning into a grapefruit! Buzzwords!

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups