Skip to content

Fix RichTextBox border artifacts when BorderStyle is None under VisualStylesMode.Net11 - #15141

Open
abineshPalanisamy wants to merge 8 commits into
dotnet:mainfrom
abineshPalanisamy:Fix_Issue_15055
Open

abineshPalanisamy wants to merge 8 commits into
dotnet:mainfrom
abineshPalanisamy:Fix_Issue_15055

Conversation

@abineshPalanisamy

@abineshPalanisamy abineshPalanisamy commented Sep 17, 2026 •

Copy link
Copy Markdown

Fixes #15055

Proposed changes

  • Fix borderless RichTextBox rendering under VisualStylesMode.Net11.
  • Prevent unwanted thin border artifacts from appearing on the top and left edges when BorderStyle = None.
  • Adjust the NET11 rendering path to preserve the expected borderless appearance.
  • Add regression test coverage for borderless rendering scenarios.

Root cause

  • The issue was reproducible only when VisualStylesMode = Net11.
  • The issue was not reproducible in Classic mode.
  • The NET11 TextBoxBase.OnNcPaint rendering path introduced unintended border artifacts when BorderStyle = None.
  • As a result, thin border lines appeared on the top and left edges of a borderless RichTextBox.
  • Borderless controls were not rendered consistently with their expected appearance.

Customer Impact

  • RichTextBox controls configured with BorderStyle.None now render correctly under VisualStylesMode.Net11.
  • Removes unwanted top and left border artifacts from borderless controls.
  • Provides a rendering experience consistent with the expected borderless appearance.

Regression?

  • No

Risk

  • Low.
  • The change is limited to the NET11 rendering path in TextBoxBase.OnNcPaint.
  • Existing behavior for FixedSingle and Fixed3D remains unchanged.
  • Classic rendering behavior is unchanged.
  • Added regression test coverage for borderless rendering scenarios.

Screenshots

Before

image

After

image

Test methodology

  • Reproduced the issue using a RichTextBox with:
    • BorderStyle = None
    • VisualStylesMode = Net11
  • Verified that thin border lines were visible on the top and left edges before the fix.
  • Verified that the border artifacts are no longer visible after the fix.
  • Verified rendering behavior in both focused and unfocused states.
  • Verified runtime border-style transition scenarios.
  • Verified that FixedSingle rendering remains unchanged.
  • Verified that Fixed3D rendering remains unchanged.
  • Added regression test coverage for borderless rendering scenarios.

Accessibility testing

Test environment(s)

  • 11.0.100-rc.1.26420.103
  • VisualStylesMode.Net11
Microsoft Reviewers: Open in CodeFlow

@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.24166%. Comparing base (1ab988e) to head (c4c77a2).

Additional details and impacted files
@@              Coverage Diff              @@
##                main      #15141   +/-   ##
=============================================
  Coverage   37.24166%   37.24166%           
=============================================
  Files            246         246           
  Lines           9774        9774           
  Branches        1029        1029           
=============================================
  Hits            3640        3640           
  Misses          5970        5970           
  Partials         164         164           
Flag Coverage Δ
Debug 37.24166% <ø> (ø)
production 39.36526% <ø> (ø)
test 20.64923% <ø> (ø)
unit 39.36526% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RichTextBox is not fully borderless with BorderStyle=None under VisualStylesMode.NET11

1 participant