将温差图例表编辑触发方式从单击改为双击
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user