From 130802fa7ef10857db12f784956d5ea122a1eeb4 Mon Sep 17 00:00:00 2001
From: C3031 <shitiangui@lanpucloud.cn>
Date: 星期五, 30 一月 2026 09:27:32 +0800
Subject: [PATCH]
---
LB_VisionControl/UserHSmartWindowControl.cs | 29 ++++++++++++++++++++++++++++-
1 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/LB_VisionControl/UserHSmartWindowControl.cs b/LB_VisionControl/UserHSmartWindowControl.cs
index a1c3acb..f91ead5 100644
--- a/LB_VisionControl/UserHSmartWindowControl.cs
+++ b/LB_VisionControl/UserHSmartWindowControl.cs
@@ -1,8 +1,12 @@
锘縰sing HalconDotNet;
+using Sunny.UI.Win32;
using System.Diagnostics;
+using System.Windows.Forms;
namespace LB_VisionControl
{
+ public delegate void Control_MouseDown(object sender, MouseEventArgs e);
+ public delegate void Control_MouseDoubleClick(object sender, MouseEventArgs e);
public partial class UserHSmartWindowControl : UserControl
{
public UserHSmartWindowControl()
@@ -18,7 +22,22 @@
// 璁剧疆榛樿瀛椾綋涓� 20鍙� mono瀛椾綋鍔犵矖
set_display_font(this.hWindowControl.HalconWindow, 20, "mono", "true", "false");
}
-
+ public event Control_MouseDown event_MouseDown;
+ public event Control_MouseDoubleClick event_MouseDoubleClick;
+ private void event_mouseDown(object sender, MouseEventArgs e)
+ {
+ if (event_MouseDown != null)
+ {
+ event_MouseDown(sender, e);
+ }
+ }
+ private void event_mouseDoubleClick(object sender, MouseEventArgs e)
+ {
+ if (event_MouseDoubleClick != null)
+ {
+ event_MouseDoubleClick(sender, e);
+ }
+ }
private void UserHSmartWindowControl_Load(object sender, EventArgs e)
{
// 鍚敤鍙岀紦鍐插噺灏戦棯鐑�
@@ -968,6 +987,8 @@
default:
break;
}
+ MouseEventArgs mouseEventArgs = new MouseEventArgs(e.Button, e.Clicks, (int)e.X, (int)e.Y, e.Delta);
+ event_mouseDown(sender, mouseEventArgs);
}
catch { }
}
@@ -1170,5 +1191,11 @@
{
ShowHoImage(hImage);
}
+
+ private void hWindowControl_HMouseDoubleClick(object sender, HMouseEventArgs e)
+ {
+ MouseEventArgs mouseEventArgs = new MouseEventArgs(e.Button, e.Clicks, (int)e.X, (int)e.Y, e.Delta);
+ event_mouseDoubleClick(sender, mouseEventArgs);
+ }
}
}
--
Gitblit v1.9.3