Пример #1
0
        public void Panel_DragDrop(object sender, DragEventArgs e)
        {
            Control ctrl = e.Data.GetData(e.Data.GetFormats(true)[0]) as Control;

            if (onDrag)
            {
                int scroll_y = owner.AutoScrollPosition.Y;

                int y     = rec.Y + 2;
                int index = ((y + 1) / 2) / 11;
                onDrag = false;

                if (ctrl is L_ListCell)
                {
                    cm.moveCell(ctrl as L_ListCell, index);
                }
                else if (ctrl is R_ListCell)
                {
                    cm.moveCell(ctrl as R_ListCell, index);
                }

                owner.AutoScrollPosition = new Point(0, -scroll_y);
            }
        }