修复进入温差图绘制状态时画笔大小按钮未显示的问题,自动选中第一行并显示画笔按钮
This commit is contained in:
@@ -732,6 +732,41 @@ namespace JoyD.Windows.CS
|
|||||||
|
|
||||||
// 调用按钮可见性更新方法设置为温差图绘制状态
|
// 调用按钮可见性更新方法设置为温差图绘制状态
|
||||||
UpdateButtonsVisibility(3); // 3表示温差图绘制状态
|
UpdateButtonsVisibility(3); // 3表示温差图绘制状态
|
||||||
|
|
||||||
|
// 确保温差图例有数据且默认选中第一行
|
||||||
|
if (dataGridViewTempDiff.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
// 清除当前选择
|
||||||
|
dataGridViewTempDiff.ClearSelection();
|
||||||
|
// 选中第一行
|
||||||
|
dataGridViewTempDiff.Rows[0].Selected = true;
|
||||||
|
// 手动触发SelectionChanged事件处理逻辑
|
||||||
|
// 这里不直接调用事件,而是直接更新画笔按钮可见性
|
||||||
|
btnBrushSize1.Visible = true;
|
||||||
|
btnBrushSize3.Visible = true;
|
||||||
|
btnBrushSize5.Visible = true;
|
||||||
|
btnBrushSize10.Visible = true;
|
||||||
|
btnBrushSize15.Visible = true;
|
||||||
|
|
||||||
|
// 确保当前选中的画笔大小按钮处于选中状态
|
||||||
|
UpdateBrushSizeButtonSelection(_currentBrushSize);
|
||||||
|
|
||||||
|
// 控制分隔条可见性
|
||||||
|
ToolStripSeparator toolStripSeparator = null;
|
||||||
|
for (int i = 0; i < toolStrip.Items.Count - 1; i++)
|
||||||
|
{
|
||||||
|
if (toolStrip.Items[i] == btnDeleteTempDiff && toolStrip.Items[i + 1] is ToolStripSeparator)
|
||||||
|
{
|
||||||
|
toolStripSeparator = toolStrip.Items[i + 1] as ToolStripSeparator;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (toolStripSeparator != null)
|
||||||
|
{
|
||||||
|
toolStripSeparator.Visible = btnDeleteTempDiff.Visible && btnBrushSize1.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user