private void thisMouseMove(object sender, MouseEventArgs e) { CheckFocusTch(sender, e.Location); //取当前聚焦的 if (ReadOnly || (schState != eSchState.common && schState != eSchState.focused) || e.Button != MouseButtons.Left || schState == eSchState.inDrop) { return; } if (Math.Abs(e.X - DownXY.X) < 5 && Math.Abs(e.Y - DownXY.Y) < 5) { return; } EnLsnAct Act = null; VcTime sTime = new VcTime(); if (sender == TaskGrid && TaskGridBind.Count > 0) { DataGridView.HitTestInfo hi = TaskGrid.HitTest(e.X, e.Y); TaskGridBind.Position = hi.RowIndex; TaskGrid.Refresh(); //有用的,让TaskGrid更新当前选中行为被选中状态 Act = TaskGridBind.Current as EnLsnAct; } else if (sender is SqdScheduleCell) { Act = (sender as SqdScheduleCell).Act; (sender as SqdScheduleCell).Time.CopyFieldTo(sTime); } if (Act != null) { ToInDropState(Act, sTime); (sender as Control).DoDragDrop(Act, DragDropEffects.Move); } }