From 2fc64c1af548596c4719d4a3abdc10de7a1d7e8f Mon Sep 17 00:00:00 2001
From: tangxu <tangxu76880903>
Date: 星期三, 26 二月 2025 20:27:40 +0800
Subject: [PATCH] 优化步骤操作

---
 WinFrmUI/DPumpHydr.WinFrmUI.Ribbon/Classes/RibbonPopupManager.cs |   34 +++++++++++++++++++---------------
 1 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/WinFrmUI/DPumpHydr.WinFrmUI.Ribbon/Classes/RibbonPopupManager.cs b/WinFrmUI/DPumpHydr.WinFrmUI.Ribbon/Classes/RibbonPopupManager.cs
index e9f7530..0301863 100644
--- a/WinFrmUI/DPumpHydr.WinFrmUI.Ribbon/Classes/RibbonPopupManager.cs
+++ b/WinFrmUI/DPumpHydr.WinFrmUI.Ribbon/Classes/RibbonPopupManager.cs
@@ -158,27 +158,31 @@
 
             if (dd != null)
             {
-                foreach (RibbonItem item in dd.Items)
+                WinApi.POINT pos;
+                if (WinApi.GetCursorPos(out pos))
                 {
-                    if (dd.RectangleToScreen(item.Bounds).Contains(e.Location))
+                    foreach (RibbonItem item in dd.Items)
                     {
-                        IScrollableRibbonItem sc = item as IScrollableRibbonItem;
-
-                        if (sc != null)
+                        if (dd.RectangleToScreen(item.Bounds).Contains(pos.x, pos.y))
+                        //if (dd.RectangleToScreen(item.Bounds).Contains(e.Location))
                         {
-                            if (e.Delta < 0)
-                            {
-                                sc.ScrollDown();
-                            }
-                            else
-                            {
-                                sc.ScrollUp();
-                            }
+                            IScrollableRibbonItem sc = item as IScrollableRibbonItem;
 
-                            return true;
+                            if (sc != null)
+                            {
+                                if (e.Delta < 0)
+                                {
+                                    sc.ScrollDown();
+                                }
+                                else
+                                {
+                                    sc.ScrollUp();
+                                }
+
+                                return true;
+                            }
                         }
                     }
-
                 }
             }
             //kevin carbis - added scrollbar support to dropdowns so we need to feed the mouse wheel to the 

--
Gitblit v1.9.3