Skip to content

After reducing the form width, clicking the ToolStrip options triggers a Win32Exception error #14094

Closed

Description

@Amy-Li03

.NET version

.NET SDK 10.0.00-rtm.25523.111

Did it work in .NET Framework?

Yes

Did it work in any of the earlier releases of .NET Core or .NET 5+?

No, it still repro on .NET 8.0 and .NET 9.0

Issue description

When the form width is reduced to prevent Toolstrip items from displaying, clicking the ToolBar Options throws a System.ComponentModel.Win32Exception (0x80004005): Failed to set Win32 parent window of the Control error.

.NET project
Image

.NET framework project
Image

Call Stack

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ComponentModel.Win32Exception (0x80004005): Failed to set Win32 parent window of the Control.
   at System.Windows.Forms.Control.SetParentHandle(HWND value)
   at System.Windows.Forms.Control.CreateControl(Boolean ignoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, UInt32 msg, WPARAM wparam, LPARAM lparam)

Steps to reproduce

  1. Create a WinForms .NET project
  2. Add a ToolStrip to form designer
  3. Add toolStripComboBox and toolStripProgressBar to ToolStrip control
  4. Ctrl + F5 to run this project
  5. Narrow down the width of form to make sure no toolstrip Item display on form designer
  6. Click on the ToolBar Options

Activity

  1. added
    untriaged
    on Dec 1, 2025
  2. KlausLoeffelmann commented on Jan 8, 2026

    @KlausLoeffelmann
    Member

    @LeafShi1, @SimonZhao888, @merriemcgaw:
    What's with this Copilot-authored fix here?

    Can you take a look at see, if it fixes it?

  3. SimonZhao888 commented on Jan 8, 2026

    @SimonZhao888
    Member

    @LeafShi1, @SimonZhao888, @merriemcgaw: What's with this Copilot-authored fix here?

    Can you take a look at see, if it fixes it?

    It didn't fix the issue, and it's not ready for review.

  4. self-assigned this
    on Jan 26, 2026
  5. removed
    untriaged
    on Sep 1, 2026
  6. Amy-Li03 commented on Sep 4, 2026

    @Amy-Li03
    ContributorAuthor

    Tested in the latest .NET 11 RC2 build: 11.0.100-rc.2.26453.107 + built private dls from the main branch of WinForms repo, it was fixed. No Win32Exception throw after clicking the ToolBar Options.

    Image
  7. added this to the 12.0-preview1 milestone on Sep 4, 2026
  8. locked and limited conversation to collaborators on Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions