Fix issue 14693: TrackBar UI control doesn't reflect properties#14697
Fix issue 14693: TrackBar UI control doesn't reflect properties#14697SimonZhao888 wants to merge 4 commits into
Conversation
LeafShi1
left a comment
There was a problem hiding this comment.
Thanks for the fix — the off-by-one in the tick loop is real and worth fixing. A few concerns to consider before merge:
-
PR description vs. code mismatch. The description says "Override the OnSizeChanged() method...", but there is no OnSizeChanged/OnResize override in the diff. The resize scenario (issue #2 in #14693) actually appears to be fixed as a side effect of making the tick count size-independent (the native control rescales stored logical tick positions on resize). Please update the description to match the code, or clarify how the resize case is covered.
-
No regression test. Since this is a runtime-only visual bug, please add a test asserting the tick count / last-interior-tick for the repro (Max=500, TickFrequency=50) so this doesn't regress again.
See inline comments for the specifics on the tick math.
Fixes #14693
Root Cause
This issue was introduced by #8060 . TrackBar does not recreate/recalculate tick marks when TickFrequency changes after a size change, causing the native control to display an outdated number of ticks.
Proposed changes
Customer Impact
Regression?
Risk
Screenshots
Before
After
14693.mp4
Test methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow