是的,那不行。调用DoDragDrop()将鼠标控制权转换为WindowsD+D逻辑,这将干扰正常的鼠标处理。您需要延迟启动D+D,直到看到用户实际在拖动。这应该能解决问题:
Point dragStart;
private void dataGridView1_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) {
if (e.Button == MouseButtons.Left) dragStart = e.Location;
}
private void dataGridView1_CellMouseMove(object sender, DataGridViewCellMouseEventArgs e) {
if (e.Button == MouseButtons.Left) {
var min = SystemInformation.DoubleClickSize;
if (Math.Abs(e.X - dragStart.X) >= min.Width ||
Math.Abs(e.Y - dragStart.Y) >= min.Height) {
}
}
}