コード例 #1
0
 private void paletteList_DragDrop(object sender, DragEventArgs e)
 {
     if (e.Effect == DragDropEffects.Move)
     {
         Point        cp         = paletteList.PointToClient(new Point(e.X, e.Y));
         ListViewItem dragToItem = paletteList.GetItemAt(cp.X, cp.Y);
         if (!paletteList.SelectedItems.Contains(dragToItem))
         {
             var dropIndex = dragToItem != null ?
                             appPal.Palette.Colors[dragToItem.Index] :
                             null;
             appPal.MoveColors(SelectedItems, dropIndex);
         }
     }
 }