Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 24, 2025

Fixes #14165

Root Cause

The MaskedTextBox text editor dropdown in PropertyGrid uses hardcoded pixel values that don't scale with DPI, causing clipped/undersized rendering at high DPI (e.g., 300%).

Proposed changes

  • MaskedTextBoxTextEditorDropDown.cs: Apply LogicalToDeviceUnits() to size and padding values in constructor

    // Before: hardcoded values
    Padding = new Padding(16);
    Size = new Drawing.Size(100, 52);
    
    // After: DPI-aware scaling
    Padding = new Padding(LogicalToDeviceUnits(16));
    Size = LogicalToDeviceUnits(new Drawing.Size(100, 52));
  • MaskedTextBoxTextEditorDropDownTests.cs: Add test verifying DPI scaling behavior

Customer Impact

  • The MaskedTextBox text editor dropdown list in PropertyGrid uses hard-coded pixel values ​​and displays correctly at different DPI settings.

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

image

After

After

Test methodology

  • Manually

Test environment(s)

  • .net 10.0.100
Microsoft Reviewers: Open in CodeFlow

Co-authored-by: SimonZhao888 <133954995+SimonZhao888@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix MaskedTextBox text editor scaling issue under High DPI Fix MaskedTextBox PropertyGrid text editor DPI scaling at runtime Dec 24, 2025
Copilot AI requested a review from SimonZhao888 December 24, 2025 02:19
@SimonZhao888 SimonZhao888 marked this pull request as ready for review December 24, 2025 06:55
@SimonZhao888 SimonZhao888 requested a review from a team as a code owner December 24, 2025 06:55
@codecov
Copy link

codecov bot commented Dec 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.16401%. Comparing base (05b7c2e) to head (62a08d4).

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #14166         +/-   ##
===================================================
+ Coverage   77.15877%   77.16401%   +0.00524%     
===================================================
  Files           3279        3279                 
  Lines         645333      645341          +8     
  Branches       47720       47720                 
===================================================
+ Hits          497931      497971         +40     
+ Misses        143719      143682         -37     
- Partials        3683        3688          +5     
Flag Coverage Δ
Debug 77.16401% <100.00000%> (+0.00524%) ⬆️
integration 19.00548% <0.00000%> (+0.00138%) ⬆️
production 52.04081% <100.00000%> (+0.01111%) ⬆️
test 97.40565% <100.00000%> (+0.00005%) ⬆️
unit 49.47230% <100.00000%> (+0.02985%) ⬆️

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.

Runtime: MaskedTextBox Text editor is not scaled correctly under High DPI (300%), while Design-time editor works fine

3 participants