MenuStripEx.cs 848 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Forms;
  7. namespace SmartCoalApplication.SystemLayer
  8. {
  9. public class MenuStripEx : MenuStrip
  10. {
  11. private bool clickThrough = true;
  12. private static int openCount = 0;
  13. public MenuStripEx()
  14. {
  15. this.ImageScalingSize = new System.Drawing.Size(UI.ScaleWidth(16), UI.ScaleHeight(16));
  16. }
  17. protected override void WndProc(ref Message m)
  18. {
  19. base.WndProc(ref m);
  20. if (this.clickThrough)
  21. {
  22. UI.ClickThroughWndProc(ref m);
  23. }
  24. }
  25. public static bool IsAnyMenuActive
  26. {
  27. get
  28. {
  29. return openCount > 0;
  30. }
  31. }
  32. }
  33. }