title: How to drag images from a listview (together with an imageview) to pictureboxes?
body: <p>I am pretty new to C# and struggle a lot with a small project I want to do.</p>
  
  <p>I am busy with something like a collage maker where I have a list of pictures on the left hand side and I want to drag and drop multiple images to the right hand side where I want to be able to move them around to create my collage.</p>
  
  <p>I wanted to show an image but I am not allowed to post images with less than 10 reputation points. But look here for the <a href="https://drive.google.com/file/d/0B-t1PtUkARFPMzJZSXFQTDNzbGc/view?usp=sharing" rel="nofollow noreferrer">image</a>:</p>
  
  <p><a href="https://i.stack.imgur.com/d5pHR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d5pHR.png" alt="enter image description here"></a></p>
  
  <p>I can't manage to get it to work. I've looked online for help but I can't really find what I'm looking for. The stuff I do find are too unclear and I struggle to understand.</p>
  
  <p>This is what I have so far for the code to drag and drop from the left to the right but it doesn't work;</p>
  
  <pre><code>private void pictureBox1_DragEnter(object sender, DragEventArgs e)
      {
          int len = e.Data.GetFormats().Length - 1;
          int i;
          for (i = 0; i &lt;= len; i++)
          {
              if (e.Data.GetFormats()[i].Equals("System.Windows.Forms.ListView+SelectedListViewItemCollection"))
              {
                  //The data from the drag source is moved to the target.
                  e.Effect = DragDropEffects.Move;
              }
          }
      }
  
      private void pictureBox1_DragDrop(object sender, DragEventArgs e)
      {
          //Return if the items are not selected in the ListView control.
          if (listView1.SelectedItems.Count == 0)
          {
              return;
          }
          ListViewItem dragitem = listView1.SelectedItems[0];
          pictureBox2.Image = imageList1.Images[dragitem.ImageIndex];
          listView1.Items.Remove(dragitem);
      }
  
      private void listView1_MouseDown(object sender, MouseEventArgs e)
      {
          listView1.DoDragDrop(listView1.SelectedItems, DragDropEffects.Move);
      }
  </code></pre>
  
  <p>And after I can add image to the left, how can I drag and move them around using the mouse coordinates?</p>
  
  <p>Any help will be appreciated please. 
  Everything is done using C# in Windows Forms.</p>