Skip to content

Patch Fixes from CargoWise.Controls.WinForms.Legacy#13

Open
zuizuihao wants to merge 4 commits intomasterfrom
SPG/legacy_patchs
Open

Patch Fixes from CargoWise.Controls.WinForms.Legacy#13
zuizuihao wants to merge 4 commits intomasterfrom
SPG/legacy_patchs

Conversation

@zuizuihao
Copy link
Copy Markdown

@zuizuihao zuizuihao commented Mar 24, 2026

WI01041726 - Legacy Control Migration: Fixes

  • Not Good Fix: avoid type issue when instantiated from ZBindingContext (WI00826420)

    Should not change WinForms source code, will fix ZBindingContext in ZArchitecture.GUI

  • Fixed: comment out Debug.Fail in PaintEventArgs (WI00857973)

    Fixed with another solution, check painteventargs-resetgraphics-failfast.md

  • Fixed In Winforms: keyboard shortcuts associated with menus not being captured (WI00895180)

    Did not reproduce in CargoWise; unsure how it was fixed. Function review required.

  • Fixed: temporarily fixed WebBrowser memory leak (WI00938771)

    Patched back before fixes in commit

  • Fixed: menu popup events not firing (WI00949199)

  • Fixed: menu bar size not taken into account in form sizing (WI00949199)

  • Fixed: menu property change should trigger size update (WI00949199)

    All UTs passed and filenames renamed as below:

    • Tests/System.Windows.Forms.Tests/MenuSizeCalculationTests.cs → MainMenuSizeCalculationTests
    • Tests/System.Windows.Forms.Tests/MainMenuTests.cs → MainMenuPopupTests.cs
    • Tests/System.Windows.Forms.Tests/AdjustWindowRectTests.cs → MainMenuAdjustWindowRectTests.cs
  • Fixed: ToolBar tooltip moving the position of the toolbar (WI00951596)

    All UTs passed

    • Tests/System.Windows.Forms.Tests/ToolBarToolTipTests.cs → ToolBarToolTipTests.cs
  • Fixed: control's anchor info (WI00955507)

    Fixed with new solution in anchor-layout-highDpi-regression.md

  • Fixed: disappearing Owner Draw MenuItem (WI00948012)

    Demo and UTs checked, all passed

    • Tests/System.Windows.Forms.Tests/MenuItemTests.cs → MenuItemTests.cs
  • Fixed In Winforms: IT Customs - NET8 NRE on Customs Declaration MISC Tab (WI01005730)

    .NET 10 includes this change: Fix #12661 Null Reference Exception: System.Windows.Forms.TabControl.<WmSelChange> dotnet/winforms#12683

ZGN-WTG and others added 4 commits March 24, 2026 17:58
Change WebBrowser references in WebBrowserSiteBase and WebBrowserEvent to a WeakReference.
Temporary fix while waiting for dotnet#13769

(cherry picked from commit 1ca4f6d)
…and fix graphics state restoration in PaintEventArgs (WI00857973)
- Added a new button in MainForm to demonstrate the AnchorLayoutHighDpiRegression.
- Refactored Program.cs to set the main method as private and removed unnecessary comments regarding high DPI settings.
- Introduced AnchorLayoutHighDpiRegressionTests to validate the behavior of bottom/right-anchored controls in high DPI scenarios.
- Created a detailed markdown document outlining the high-DPI regression issues and proposed solutions.
- Added compatibility logic in DefaultLayout.AnchorLayoutCompat.cs to handle stale positive anchors and stretch-anchor recovery.
- Updated DefaultLayout.cs to integrate the new compatibility checks for anchor information during layout calculations.
…dotnet#33)

WI00949199 - form size should be recalculated when menu changes (dotnet#36)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants