为Camera控件添加双击事件,实现双击后弹出检测配置窗口

This commit is contained in:
zqm
2025-11-06 09:55:14 +08:00
parent f135a4b17d
commit 87ae816e6a
2 changed files with 23 additions and 1 deletions

View File

@@ -58,6 +58,7 @@ namespace JoyD.Windows.CS.Toprie
this.imageBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.imageBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.imageBox.TabIndex = 0; this.imageBox.TabIndex = 0;
this.imageBox.TabStop = false; this.imageBox.TabStop = false;
this.imageBox.DoubleClick += new System.EventHandler(this.imageBox_DoubleClick);
// //
// contextMenuStrip1 // contextMenuStrip1
// //
@@ -297,4 +298,4 @@ namespace JoyD.Windows.CS.Toprie
private System.Windows.Forms.ToolStripMenuItem minTemperatureToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem minTemperatureToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveLogToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem saveLogToolStripMenuItem;
} }
} }

View File

@@ -2203,5 +2203,26 @@ namespace JoyD.Windows.CS.Toprie
Console.WriteLine($"保存温度数据异常: {ex.Message}\n{ex.StackTrace}"); Console.WriteLine($"保存温度数据异常: {ex.Message}\n{ex.StackTrace}");
} }
} }
/// <summary>
/// imageBox双击事件处理方法
/// 双击后弹出检测配置窗口
/// </summary>
private void imageBox_DoubleClick(object sender, EventArgs e)
{
try
{
// 创建并显示检测配置窗口
Setting settingForm = new Setting();
// 显示配置窗口
settingForm.ShowDialog();
}
catch (Exception ex)
{
Console.WriteLine($"打开配置窗口时出错: {ex.Message}");
MessageBox.Show($"打开配置窗口时出错: {ex.Message}", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
} }
} }