现在的代码我是这样处理的,但是不能实现拖放,不知错误在那??
 private void Form1_Load(object sender, EventArgs e)
        {
            imageList1.ColorDepth = ColorDepth.Depth24Bit;
            imageList1.ImageSize = new Size(120, 120);
            for (int i = 0; i < 12; i++)
            {
                imageList1.Images.Add(Image.FromFile(@"E:\123\"  + (i + 1).ToString() + ".jpg"));
                listView1.LargeImageList = imageList1;
                listView1.Items.Add("AAA" + (i + 1).ToString());
                listView1.Items[i].ImageIndex = i;
            }
       }private void listView1_ItemDrag(object sender, ItemDragEventArgs e)
        {
            DoDragDrop(e.Item.ToString(), DragDropEffects.Copy);  
        }private void UpLoad1_DragEnter(object sender, DragEventArgs e)
        {
            ListView lvi = (ImageList)e.Data.GetData(typeof(ListView));
            if (lvi != null)
            {
                e.Effect = DragDropEffects.Move;
            }
            else
                Cursor = Cursors.No;            // 判断是不是可以接收的数据类型  
            if (e.Data.GetDataPresent(DataFormats.Bitmap))
                e.Effect = DragDropEffects.Copy;
            else
                e.Effect = DragDropEffects.None;
        }private void UpLoad1_DragDrop(object sender, DragEventArgs e)
        {
            UpLoad7.Image = (Bitmap)(e.Data.GetData(DataFormats.Bitmap));
        }

解决方案 »

  1.   

    现在写成这个样子,还是不行!!!
        private void listView1_ItemDrag(object sender, ItemDragEventArgs e)
            {
                this.DoDragDrop(e.Item, DragDropEffects.Move);
            }        private void listView1_DragEnter(object sender, DragEventArgs e)
            {
                e.Effect = DragDropEffects.Move;
            }
            private void UpLoad1_DragEnter(object sender, DragEventArgs e)
            {
                //判定是否现在拖动的数据是LISTVIEW项
                ListViewItem lvi = (ListViewItem)e.Data.GetData(typeof(ListViewItem));
                if (lvi != null)
                {
                    e.Effect = DragDropEffects.Copy;
                }
                else
                    Cursor = Cursors.No;        }        private void UpLoad1_DragDrop(object sender, DragEventArgs e)
            {
               // ListViewItem lvi = (ListViewItem)e.Data.GetData(typeof(ListViewItem)); 
                UpLoad1.Image = (Bitmap)(e.Data.GetData(DataFormats.Bitmap));
            }