修改颜色列处理逻辑,改为双击才修改颜色

This commit is contained in:
zqm
2025-11-10 11:11:16 +08:00
parent af5cbbd06f
commit 48d3792464

View File

@@ -317,11 +317,22 @@ namespace JoyD.Windows.CS
} }
private void DataGridViewTempDiff_CellClick(object sender, DataGridViewCellEventArgs e) private void DataGridViewTempDiff_CellClick(object sender, DataGridViewCellEventArgs e)
{
// 移除颜色列点击处理逻辑,颜色列修改改为双击触发
// 温差值列点击不再直接进入编辑模式,改为双击进入
}
private void DataGridViewTempDiff_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{ {
if (e.RowIndex >= 0 && e.RowIndex < tempDiffData.Count) if (e.RowIndex >= 0 && e.RowIndex < tempDiffData.Count)
{ {
// 处理颜色列点击 // 处理温差值列双击 - 双击时启动编辑模式
if (e.ColumnIndex == dataGridViewTempDiff.Columns["colorColumn"].Index) if (e.ColumnIndex == dataGridViewTempDiff.Columns["tempDiffValue"].Index)
{
dataGridViewTempDiff.BeginEdit(true);
}
// 处理颜色列双击 - 双击时打开颜色选择对话框
else if (e.ColumnIndex == dataGridViewTempDiff.Columns["colorColumn"].Index)
{ {
using (ColorDialog colorDialog = new ColorDialog()) using (ColorDialog colorDialog = new ColorDialog())
{ {
@@ -337,19 +348,6 @@ namespace JoyD.Windows.CS
} }
} }
} }
// 温差值列点击不再直接进入编辑模式,改为双击进入
}
}
private void DataGridViewTempDiff_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex >= 0 && e.RowIndex < tempDiffData.Count)
{
// 处理温差值列双击 - 双击时启动编辑模式
if (e.ColumnIndex == dataGridViewTempDiff.Columns["tempDiffValue"].Index)
{
dataGridViewTempDiff.BeginEdit(true);
}
} }
} }