From 79694cc033e9ffe31b0430bfd07641d9479af028 Mon Sep 17 00:00:00 2001 From: zqm Date: Mon, 10 Nov 2025 10:38:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E6=B8=A9=E5=B7=AE=E5=9B=BE=E4=BE=8B?= =?UTF-8?q?=E8=A1=A8=E7=BC=96=E8=BE=91=E8=A7=A6=E5=8F=91=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E4=BB=8E=E5=8D=95=E5=87=BB=E6=94=B9=E4=B8=BA=E5=8F=8C=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs b/Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs index 2f6c683..3b77cd7 100644 --- a/Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs +++ b/Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs @@ -132,6 +132,8 @@ namespace JoyD.Windows.CS dataGridViewTempDiff.CellFormatting += new DataGridViewCellFormattingEventHandler(DataGridViewTempDiff_CellFormatting); // 添加编辑控件显示事件用于设置编辑控件属性 dataGridViewTempDiff.EditingControlShowing += new DataGridViewEditingControlShowingEventHandler(DataGridViewTempDiff_EditingControlShowing); + // 添加单元格双击事件用于触发编辑模式 + dataGridViewTempDiff.CellDoubleClick += new DataGridViewCellEventHandler(DataGridViewTempDiff_CellDoubleClick); // 添加一些示例数据 AddSampleTempDiffData(); @@ -312,7 +314,7 @@ namespace JoyD.Windows.CS { if (e.RowIndex >= 0 && e.RowIndex < tempDiffData.Count) { - // 处理颜色列点击 + // 只处理颜色列点击 if (e.ColumnIndex == dataGridViewTempDiff.Columns["colorColumn"].Index) { using (ColorDialog colorDialog = new ColorDialog()) @@ -329,8 +331,16 @@ namespace JoyD.Windows.CS } } } - // 处理温差值列点击 - 当点击温差值列时,启动编辑模式 - else if (e.ColumnIndex == dataGridViewTempDiff.Columns["tempDiffValue"].Index) + // 温差值列点击不再直接进入编辑模式,改为双击进入 + } + } + + 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); }