Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 3, 2025

Fixes #13640

Proposed changes

  • Add RendererOverride delegation to OnRenderToolStripStatusLabelBackground in ToolStripSystemRenderer
  • Add RendererOverride delegation to OnRenderLabelBackground in ToolStripSystemRenderer
  • Add OnRenderToolStripStatusLabelBackground override in ToolStripHighContrastRenderer to fill background with highlight color when selected

Customer Impact

  • ToolStripStatusLabel and ToolStripLabel items with IsLink=true are now visible in High Contrast mode when using System RenderMode
  • Selected link items now properly render with highlight background, making text readable

Regression?

  • No

Risk

  • Low. Follows existing pattern used by OnRenderButtonBackground and other rendering methods.

Test methodology

  • Added ToolStripStatusLabelTests.Rendering.cs with High Contrast rendering tests
  • Added ToolStripLabelTests.Rendering.cs with High Contrast rendering tests
  • Tests verify selected items render with SystemColors.Highlight background

Accessibility testing

This PR fixes an accessibility bug. The root cause was that OnRenderToolStripStatusLabelBackground and OnRenderLabelBackground did not delegate to RendererOverride, preventing ToolStripHighContrastRenderer from filling the background with highlight color for selected items.

Test environment(s)

  • Windows with High Contrast theme enabled
  • .NET 10.0

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 0t3vsblobprodcus362.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/winforms/winforms/.dotnet/dotnet /home/REDACTED/work/winforms/winforms/.dotnet/dotnet restore (dns block)
  • imzvsblobprodcus368.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/winforms/winforms/.dotnet/dotnet /home/REDACTED/work/winforms/winforms/.dotnet/dotnet msbuild /m /nologo /clp:Summary /v:minimal /nr:true /warnaserror /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /home/REDACTED/work/winforms/winforms/artifacts/toolset/restore.proj /bl:/home/REDACTED/work/winforms/winforms/artifacts/log/Debug/ToolsetRestore.binlog /t:__WriteToolsetLocation /clp:ErrorsOnly;NoSummary /p:__ToolsetLocationOutputFile=/home/REDACTED/work/winforms/winforms/artifacts/toolset/11.0.0-beta.25601.107.txt (dns block)
    • Triggering command: /home/REDACTED/work/winforms/winforms/.dotnet/dotnet /home/REDACTED/work/winforms/winforms/.dotnet/dotnet restore (dns block)
    • Triggering command: /home/REDACTED/work/winforms/winforms/.dotnet/dotnet /home/REDACTED/work/winforms/winforms/.dotnet/dotnet build src/System.Windows.Forms/System.Windows.Forms.csproj --no-restore (dns block)
  • l49vsblobprodcus358.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/winforms/winforms/.dotnet/dotnet /home/REDACTED/work/winforms/winforms/.dotnet/dotnet restore (dns block)
  • rcxvsblobprodcus328.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/winforms/winforms/.dotnet/dotnet /home/REDACTED/work/winforms/winforms/.dotnet/dotnet build src/System.Windows.Forms/System.Windows.Forms.csproj --no-restore (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[Accessibility][High Contrast] The text of toolStripStatuslabel item is not visible in HC Mode when setting the RenderMode as System & Enable the IsLink</issue_title>
<issue_description>### .NET version

latest .NET 10.0

Did it work in .NET Framework?

No

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

The issue can reproduce 8.0/9.0 & .NET Framework

Issue description

The text of toolStripStatuslabel item is not visible in HS Mode when setting the RenderMode as System & Enable the IsLink

RuntimeIssue.mp4

Steps to reproduce

  1. Create a .NET winforms project
  2. Add a ToolStrip control, and set the RenderMode as System
  3. Add a toolStripStatusLabel item for the toolstrip1, and Enable IsLink option
  4. Add a app.manifest file for this project, and then uncomment the below code section
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
  1. Build & Run the application
  2. Observe the text of toolStripStatuslabel item after mouse on over it

Or open & build & run the attached reproduce application
ReproApplication.zip

More info:

  1. The issue only can reproduce RenderMode as System, not reproduce on ManagerRenderMode & Professional modes
  2. The issue also can reproduce .NET Framework application
  3. The issue also can reproduce on toolStripStatusLabel1 item for StatusStrip control</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Microsoft Reviewers: Open in CodeFlow

…ystem RenderMode

- Added RendererOverride delegation to OnRenderToolStripStatusLabelBackground in ToolStripSystemRenderer
- Added RendererOverride delegation to OnRenderLabelBackground in ToolStripSystemRenderer
- Added OnRenderToolStripStatusLabelBackground override in ToolStripHighContrastRenderer to fill with highlight color when selected
- Added rendering tests for ToolStripStatusLabel and ToolStripLabel in High Contrast mode

Co-authored-by: SimonZhao888 <[email protected]>
Copilot AI changed the title [WIP] Fix toolStripStatusLabel text visibility in high contrast mode Fix ToolStripStatusLabel text visibility in High Contrast mode with System RenderMode Dec 3, 2025
Copilot AI requested a review from SimonZhao888 December 3, 2025 02:56
Copilot finished work on behalf of SimonZhao888 December 3, 2025 02:56
@dotnet-policy-service dotnet-policy-service bot added the draft draft PR label Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

draft draft PR

Projects

None yet

2 participants