Skip to content

[VisualStylesMode: Net11] GroupBox with FlatStyle = Popup/Flat displays an accent-colored header even when it is inactive #14774

Description

@Olina-Zhang

.NET version

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

Did it work in .NET Framework?

Not tested/verified

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

Not support, new feature of #14768

Issue description

When VisualStylesMode is set to NET11, a GroupBox with FlatStyle = Popup or Flat display its header or border using the Windows accent color even when neither the GroupBox nor any of its child controls has focus.

In the attached screenshot, Button2 has the focus and correctly displays the accent-colored focus indicator. However, Popup GroupBox also displays an accent-colored header despite being inactive.

The issue does not reproduce GroupBox with other FlatStyle values: Standard and System.

Image

Steps to reproduce

  1. Set the Windows Accent Color to a noticeable color.
  2. Create a WinForms application targeting .NET 11.
  3. Set the Form's VisualStylesMode to NET11.
  4. Add multiple GroupBox controls using different FlatStyle values.
  5. Set one GroupBox to FlatStyle = Popup or Flat.
  6. Run the application.
  7. Ensure another control (e.g. a Button) has focus.

Metadata

Metadata

Labels

🪲 bugProduct bug (most likely)NewApi-Net11Tracks issues for public APIs targeted for .NET 11.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions