Skip to content

Conversation

LeafShi1
Copy link
Member

@LeafShi1 LeafShi1 commented Aug 8, 2025

Fixes #13780

Proposed changes

  • Add judgement IsDarkModeEnabled for SelectionForeColor of DataGridView TextBoxCell

Customer Impact

  • The selected item of the control DataGridView can be show clearly in DarkMode

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

Image

After

image

Test methodology

  • Manually

Test environment(s)

  • .net 10.0.0-rc.1.25406.102
Microsoft Reviewers: Open in CodeFlow

Copy link

codecov bot commented Aug 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.10767%. Comparing base (1a08ff2) to head (48b13a4).
⚠️ Report is 43 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #13792         +/-   ##
===================================================
+ Coverage   77.08387%   77.10767%   +0.02379%     
===================================================
  Files           3271        3273          +2     
  Lines         644354      644884        +530     
  Branches       47658       47686         +28     
===================================================
+ Hits          496693      497255        +562     
+ Misses        143981      143950         -31     
+ Partials        3680        3679          -1     
Flag Coverage Δ
Debug 77.10767% <100.00000%> (+0.02379%) ⬆️
integration 18.99062% <100.00000%> (ø)
production 51.92470% <100.00000%> (+0.03616%) ⬆️
test 97.41248% <ø> (-0.00361%) ⬇️
unit 49.34187% <100.00000%> (+0.04122%) ⬆️

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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the visibility of selected DataGridView text in dark mode by conditionally setting the SelectionForeColor based on the dark mode state. The change ensures that selected text remains readable when dark mode is enabled.

Key changes:

  • Modified the DefaultDefaultCellStyle property to use conditional logic for SelectionForeColor
  • Added dark mode detection using Application.IsDarkModeEnabled
  • Applied appropriate pragma warnings for the experimental API

@KlausLoeffelmann KlausLoeffelmann changed the title Add judgement "IsDarkModeEnabled" for SelectionForeColor of DataGridView Add check "IsDarkModeEnabled" for SelectionForeColor of DataGridView Aug 13, 2025
@LeafShi1 LeafShi1 added the waiting-review This item is waiting on review by one or more members of team label Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-DataGridView waiting-review This item is waiting on review by one or more members of team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dark Mode] The color contrast for selected DataGridViewTextBox is insufficient
1 participant