Skip to content

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

Closed

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.

Activity

  1. added
    untriaged
    on Jul 20, 2026
  2. added
    🪲 bug
    NewApi-Net11
    and removed
    untriaged
    on Jul 20, 2026
  3. changed the title [-][VisualStylesMode: Net11] Button hosted on a TabPage does not use the Windows accent-colored focus indicator with VisualStylesMode = NET11[/-] [+]Button hosted on a TabPage does not use the Windows accent-colored focus indicator with VisualStylesMode = NET11[/+] on Jul 21, 2026
  4. self-assigned this
    on Aug 6, 2026
  5. LeafShi1 commented on Sep 3, 2026

    @LeafShi1
    Member

    @KlausLoeffelmann @SimonZhao888 Referring to the WinUI effect, could we consider removing the background highlight and only drawing a rounded border when the button is focused?

    My concern is that if a button is supposed to be highlighted using the Accent Color, it should probably appear that way from the beginning rather than only when it receives focus.

    Maybe Accent-colored buttons should be handled through a dedicated opt-in property (for example, a UseAccentColor property), while the focus state only adds an Accent-colored border.

    Recording.2026-09-02.202935.mp4
  6. Olina-Zhang commented on Sep 4, 2026

    @Olina-Zhang
    MemberAuthor

    Verified in the .NET 11 RC2 build: 11.0.100-rc.2.26453.107 + private dlls built from main branch of Winforms repo, it was fixed:
    Image

    Image
  7. Zheng-Li01 commented on Sep 23, 2026

    @Zheng-Li01
    Member

    Verified the issue with .NET 11 Oct 2026 Update Validation test pass build .NET 11.0.0-RC.2.26427.104, the issue has been fixed that have the same test results as above.

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

Metadata

Metadata

Assignees

Labels

🪲 bugNewApi-Net11

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions