dotnet / dotnet/winforms

ToolStripTextBox renders incorrectly when hosted in MenuStrip

Open
#14,793 2 comments 0 reactions 1 assignee Assigned to @SimonZhao888 View on GitHub
:books: documentation area-DarkMode NewApi-Net11 rendering-or-artifacts-issues
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
1d 13m
Merged PRs (30d)
85

Description

### .NET version

.NET 11.0.100-preview.7.26365.114 + Private dlls built from Net11/Integration-4 branch of https://github.com/KlausLoeffelmann/winforms repo

### Did it work in .NET Framework?

Does not apply - did not exist before.

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

Not support, new feature of https://github.com/dotnet/winforms/pull/14792

### Issue description

When running in **Dark Mode** with **VisualStylesMode = .NET11**, a `ToolStripTextBox` hosted in a `MenuStrip` is rendered incorrectly.

Unlike the same control hosted in a `ToolStrip`, the `MenuStrip` version displays an unexpected light-colored rectangular area on the right side of the text box. The background is not rendered using the Dark Mode color scheme, resulting in an obvious visual artifact.

Image

### Steps to reproduce

1. Create a WinForms application.
2. Set `VisualStylesMode` to `NET11`.
3. Enable Dark Mode.
4. Add a `ToolStripTextBox` to a `MenuStrip`.
5. Run the application.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.