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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Need help in drag and drop

Need help in drag and drop

Scheduled Pinned Locked Moved C#
helptutorial
3 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.
  • S Offline
    S Offline
    Sami Sammour
    wrote on last edited by
    #1

    I'm trying to do an drag and drop example but it failed. my code is: public partial class Form1 : Form { private String f; public Form1() { InitializeComponent(); f = "D:\\Special"; String[] files = Directory.GetFiles( f ); foreach ( String fi in files ) { listView1.Items.Add( fi ); } } private void listView1_ItemDrag( object sender, ItemDragEventArgs e ) { DoDragDrop( new DataObject( DataFormats.FileDrop, ( ( ListViewItem ) e.Item ).Text ), DragDropEffects.Copy ); } } Please help me, it's very urgent.

    D 1 Reply Last reply
    0
    • S Sami Sammour

      I'm trying to do an drag and drop example but it failed. my code is: public partial class Form1 : Form { private String f; public Form1() { InitializeComponent(); f = "D:\\Special"; String[] files = Directory.GetFiles( f ); foreach ( String fi in files ) { listView1.Items.Add( fi ); } } private void listView1_ItemDrag( object sender, ItemDragEventArgs e ) { DoDragDrop( new DataObject( DataFormats.FileDrop, ( ( ListViewItem ) e.Item ).Text ), DragDropEffects.Copy ); } } Please help me, it's very urgent.

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      Check out this article[^].

      Dave
      BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
      Expect everything to be hard and then enjoy the things that come easy. (code-frog)

      S 1 Reply Last reply
      0
      • D DaveyM69

        Check out this article[^].

        Dave
        BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
        Expect everything to be hard and then enjoy the things that come easy. (code-frog)

        S Offline
        S Offline
        Sami Sammour
        wrote on last edited by
        #3

        Thank you for it, but I've already read it, and I did the same but it didn't work with me, that's why I'm so confused.

        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