Skip to content

Conversation

@LeafShi1
Copy link
Member

@LeafShi1 LeafShi1 commented Nov 20, 2025

Fixes #14062

Proposed changes

  • Override StatusStrip.DisplayRectangle When SizingGrip == true:
    • Compute DPI-scaled grip width via ScaleHelper.ScaleToDpi(GripWidth, DeviceDpi).
    • If RightToLeft == Yes, subtract width from the left and shift rect.X to the right by the grip width.
    • If RightToLeft == No, subtract width from the right side.
    • Use Math.Max(0, …) to guarantee non-negative width.

Customer Impact

  • When SizingGrip is enabled, the text of the ToolStripStatusLabel at the end no longer overlaps with or is truncated by the grip, especially when mixed with labels set to Spring = true, resulting in greater stability.

Regression?

  • Yes

Risk

  • Minimal

Screenshots

Before

The right label is missing when the first ToolStripStatusLabel has Spring = True

image

After

The right-side label is displayed in full.

AfterChange.mp4

Test methodology

  • Manually

Test environment(s)

  • 10.0.0-rc.3.25569.110
Microsoft Reviewers: Open in CodeFlow

Copy link
Contributor

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 fixes issue #14062 by overriding the DisplayRectangle property in StatusStrip to properly exclude the sizing grip width when SizingGrip is enabled. This prevents ToolStripStatusLabel items from overlapping with or being truncated by the grip, especially when using Spring = true.

Key changes:

  • Override DisplayRectangle property to reduce available space by the DPI-scaled grip width when SizingGrip is enabled
  • Handle RTL layouts by adjusting both X position and width for right-to-left, or just width for left-to-right
  • Document the new public API surface in PublicAPI.Unshipped.txt

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
StatusStrip.cs Adds DisplayRectangle property override to exclude sizing grip width from layout space when SizingGrip is enabled, with proper DPI scaling and RTL handling
PublicAPI.Unshipped.txt Documents the new public API surface for the DisplayRectangle override

@codecov
Copy link

codecov bot commented Nov 21, 2025

Codecov Report

❌ Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 77.16237%. Comparing base (8622bfb) to head (a7fcf68).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #14068         +/-   ##
===================================================
+ Coverage   77.15882%   77.16237%   +0.00354%     
===================================================
  Files           3279        3279                 
  Lines         645317      645334         +17     
  Branches       47718       47721          +3     
===================================================
+ Hits          497919      497955         +36     
+ Misses        143711      143690         -21     
- Partials        3687        3689          +2     
Flag Coverage Δ
Debug 77.16237% <95.00000%> (+0.00354%) ⬆️
integration 19.00767% <0.00000%> (+0.01176%) ⬆️
production 52.03676% <94.11765%> (+0.00943%) ⬆️
test 97.40749% <100.00000%> (ø)
unit 49.46902% <94.11765%> (+0.00054%) ⬆️

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.

SimonZhao888
SimonZhao888 previously approved these changes Nov 21, 2025
ricardobossan
ricardobossan previously approved these changes Nov 26, 2025
Copy link
Member

@ricardobossan ricardobossan left a comment

Choose a reason for hiding this comment

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

All LGTM!

@LeafShi1 LeafShi1 dismissed stale reviews from ricardobossan and SimonZhao888 via 7f3332b November 26, 2025 10:40
…e area of ​​intersection between an item and a SizingGrip exceeds a certain threshold (e.g., >50%).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VS2026 .Net10 WinForms - Missing ToolStripStatusLabel on StatusStrip when using TooStripStatusLabel.Spring=true

3 participants