Skip to content

CheckBox/RadioButton: ToggleSwitch renders black background when BackColor is Transparent #14807

Description

@Olina-Zhang

.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?

Not tested/verified

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

Not support, new feature of #14792

Issue description

When a CheckBox or RadioButton is configured with:

  • Appearance = Appearance.ToggleSwitch
  • BackColor = Color.Transparent
  • Application.VisualStylesMode = VisualStylesMode.Net11

the control is rendered with an unexpected black rectangular background.

The ToggleSwitch glyph itself is painted correctly, but the control background is not rendered transparently as expected.

Image

Steps to reproduce

  1. Create a new WinForms application targeting .NET 11 Preview.
  2. Enable VisualStylesMode to Net11;
  3. Add a CheckBox or RadioButton to the form.
  4. Set the following properties:
  • Appearance = Appearance.ToggleSwitch
  • BackColor = Color.Transparent
  1. Run the application.

WinFormsApp179.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    NewApi-Net11Tracks issues for public APIs targeted for .NET 11.untriagedThe team needs to look at this issue in the next triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions