void col_MouseUp(object sender, MouseEventArgs e) { if (IsMove == false) { return; } if (IsManage && e.Button == MouseButtons.Left) { if (CellTo != null) { var v = CellFrom.ContainControl; CellFrom.Tag = CellFrom.ContainControl = CellTo.Tag == null ? null : CellTo.Tag as Control; CellTo.Tag = CellTo.ContainControl = v; if (ControlCellChanged != null) { if (CellFrom.ContainControl != null) { ControlCellChanged(CellFrom); } if (CellTo.ContainControl != null) { ControlCellChanged(CellTo); } } } pic_img.Visible = false; pan_Add.Visible = false; _CellTo = null; //GZFrameworkDemo.Library.ModuleFun.GZLockMouse.Unlock(); IsMove = false; } }
void col_MouseDown(object sender, MouseEventArgs e) { if (IsManage && e.Button == MouseButtons.Left) { Location = (sender as Control).Location; Point P = new Point(e.X + Location.X, e.Y + Location.Y); CellFrom = GT.GetCellByPoint(P); var CurrentCol = CellFrom.ContainControl; pic_img.Image = (CurrentCol as SimpleButton).Image; _P = new Point(e.X, e.Y); pic_img.Location = new Point(P.X - (pic_img.Width / 2), P.Y - (pic_img.Height / 2)); } }