Skip to content

Button hosted on a TabPage does not use the Windows accent-colored focus indicator with VisualStylesMode = NET11 #14772

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?

Yes

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 Button correctly uses the Windows accent-colored focus indicator when hosted directly on a Form or on other common container controls: Panel, GroupBox, FlowLayoutPanel, TableLayoutPanel, SplitContainer.Panel.
However, when the same Button is hosted on a TabPage, it does not use the Windows accent color and instead falls back to the traditional focus rendering.
The behavior is inconsistent and appears to depend on the parent container.

Button in GroupBox:

Image

Button in TabControl.TabPage:

Image

Steps to reproduce

  1. In Windows Settings > Personalization > Colors, select a noticeable Accent color (for example, Red).
  2. Create a WinForms application targeting .NET 11.
  3. Set the Form's VisualStylesMode to NET11.
  4. Add:
  • A Button directly on the Form.
  • A TabControl containing a TabPage with another Button.
  1. Run the application.
  2. Focus both buttons using either the mouse or the keyboard.

Metadata

Metadata

Labels

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

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions