修改颜色列处理逻辑,改为双击才修改颜色
This commit is contained in:
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user