Skip to content

Problem with LabelEditNativeWindow #14657

Closed

Description

@twoelfer

I see quite a bit of exception logs from customer machines with a call stack pointing to "LabelEditNativeWindow". This seems to have something to do with assisting technologies like screen readers and suchlike. i have tried all sorts of things (running narrator, running zoom, putting pressure on the runtime, using different flags for how it does gc - but i cannot repro this on any of my machines.). After working on that for some days, i do think this is a bug in winforms somehow. all of the callstacks that i have seen start somewhere in my code but all of them, no matter what, end up in that stack inside winforms. Any suggestions what i might do about this?

Application: baustatik.exe CoreCLR Version: 10.0.926.27113 .NET Version: 10.0.9
Description: The application requested process termination through System.Environment.FailFast.
Message: A callback was made on a garbage collected delegate of type 'System.Windows.Forms!System.Windows.Forms.LabelEditNativeWindow+WINEVENTPROC::Invoke'.
Stack:

at Windows.Win32.PInvokeCore.CallWindowProc(Windows.Win32.Foundation.LRESULT (Windows.Win32.Foundation.HWND, UInt32, Windows.Win32.Foundation.WPARAM, Windows.Win32.Foundation.LPARAM), Windows.Win32.Foundation.HWND, UInt32, Windows.Win32.Foundation.WPARAM, Windows.Win32.Foundation.LPARAM)
at Windows.Win32.PInvokeCore.CallWindowProc(Windows.Win32.Foundation.LRESULT (Windows.Win32.Foundation.HWND, UInt32, Windows.Win32.Foundation.WPARAM, Windows.Win32.Foundation.LPARAM), Windows.Win32.Foundation.HWND, UInt32, Windows.Win32.Foundation.WPARAM, Windows.Win32.Foundation.LPARAM)
at System.Windows.Forms.Control.DefWndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.PropertyGridInternal.PropertyGridView+GridViewTextBox.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.NativeWindow.Callback(Windows.Win32.Foundation.HWND, UInt32, Windows.Win32.Foundation.WPARAM, Windows.Win32.Foundation.LPARAM)
at Windows.Win32.PInvoke.<SetWindowText>g__LocalExternFunction 2890_0(Windows.Win32.Foundation.HWND, Windows.Win32.Foundation.PCWSTR)
at Windows.Win32.PInvoke.<SetWindowText>g__LocalExternFunction 2890_0(Windows.Win32.Foundation.HWND, Windows.Win32.Foundation.PCWSTR)
at Windows.Win32.PInvoke.SetWindowText(Windows.Win32.Foundation.HWND, Windows.Win32.Foundation.PCWSTR)
at System.Windows.Forms.TextBoxBase.set_WindowText(System.String)
at System.Windows.Forms.Control.set_Text(System.String)
at System.Windows.Forms.TextBoxBase.set_Text(System.String)
at System.Windows.Forms.PropertyGridInternal.PropertyGridView+GridViewTextBox.set_Text(System.String)
at System.Windows.Forms.PropertyGridInternal.PropertyGridView.CommitValue(System.Windows.Forms.PropertyGridInternal.GridEntry, System.Object, Boolean)
at System.Windows.Forms.PropertyGridInternal.GridEntry.EditPropertyValue(System.Windows.Forms.PropertyGridInternal.PropertyGridView)
at System.Windows.Forms.PropertyGridInternal.PropertyDescriptorGridEntry.EditPropertyValue(System.Windows.Forms.PropertyGridInternal.PropertyGridView)
at System.Windows.Forms.PropertyGridInternal.PropertyGridView.PopupEditor(Int32)
at System.Windows.Forms.PropertyGridInternal.PropertyGridView.OnButtonClick(System.Object, System.EventArgs)
at System.Windows.Forms.Button.OnClick(System.EventArgs)
at System.Windows.Forms.Button.OnMouseUp(System.Windows.Forms.MouseEventArgs)
at System.Windows.Forms.Control.WmMouseUp(System.Windows.Forms.Message ByRef, System.Windows.Forms.MouseButtons, Int32)
at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Button.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.NativeWindow.Callback(Windows.Win32.Foundation.HWND, UInt32, Windows.Win32.Foundation.WPARAM, Windows.Win32.Foundation.LPARAM)
at Windows.Win32.PInvoke.DispatchMessage(Windows.Win32.UI.WindowsAndMessaging.MSG*)
at System.Windows.Forms.Application+LightThreadContext.FPushMessageLoop(Microsoft.Office.msoloop)
at System.Windows.Forms.Application+LightThreadContext.RunMessageLoop(Microsoft.Office.msoloop, Boolean)
at System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Microsoft.Office.msoloop, System.Windows.Forms.ApplicationContext)
at System.Windows.Forms.Application.Run(System.Windows.Forms.Form)
at DIE.Framework.ApplicationModell.ApplicationLoader.StartApplication(System.String[])
at DIE.Applications.Faltwerk.Program.Main(System.String[])

Activity

  1. added
    tenet-accessibility
    untriaged
    on Jun 19, 2026
  2. self-assigned this
    on Jun 22, 2026
  3. removed
    untriaged
    on Jun 24, 2026
  4. twoelfer commented on Jun 25, 2026

    @twoelfer
    Author

    Is there anything i can do to help with that issue. (Sorry for the rookie question, i am new to the "github" modus operandi.)

  5. Zheng-Li01 commented on Sep 10, 2026

    @Zheng-Li01
    Member

    Verified the issue with .NET 11.0.0-rc.2.26458.109 + private dlls built from main branch of dotnet /winforms repo that the Applications using screen readers (e.g., Narrator) no longer crash when editing PropertyGrid or TreeView with accessibility enabled as below screenshot.
    14657.zip

    14657.mp4
  6. added this to the 12.0-preview1 milestone on Sep 10, 2026
  7. twoelfer commented on Sep 10, 2026

    @twoelfer
    Author

    Do you know if this code is already in windowsdesktop-runtime 10.0.12 ? (or how i can find out if it is in there? and if not, how can i find out in which upcoming version of the windowsdesktop-runtime it will be?)

  8. locked and limited conversation to collaborators on Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

tenet-accessibility

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions