Fix Setting SplitContainer.Panel2MinSize incorrectly changes SplitterDistance#14718
Open
Sathish-087 wants to merge 2 commits into
Open
Fix Setting SplitContainer.Panel2MinSize incorrectly changes SplitterDistance#14718Sathish-087 wants to merge 2 commits into
Sathish-087 wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3568
Proposed changes
SplitContainer.ApplyPanel2MinSizeto respect the currentOrientationwhen evaluating the size ofPanel2.Panel2.Width; for horizontal orientation, usePanel2.Heightwhen enforcingPanel2MinSize.Panel2is actually smaller than the required minimum size, preventing unintended splitter repositioning.Customer Impact
SplitterDistancefrom being modified unexpectedly when updatingPanel2MinSizeon a horizontally orientedSplitContainer.Panel2MinSize.Regression?
Risk
ApplyPanel2MinSizelogic and only affects the condition and calculation used when enforcing the minimum size ofPanel2. Existing behavior for vertical orientation remains unchanged while horizontal orientation now uses the correct dimension.Screenshots
Before
Repro using the code from the reported issue:
Before Panel2MinSize: 25
Before Panel2Height: 223
Before Panel2Width: 182
Before SplitterDistance: 226
splitContainer.Panel2MinSize = 205;
After Panel2MinSize: 205
After Panel2Height: 263
After Panel2Width: 182
After SplitterDistance: 186
SplitterDistance is changed unexpectedly and Panel2.Height is modified even though the requested minimum size is already satisfied.
After
Before Panel2MinSize: 25
Before Panel2Height: 221
Before Panel2Width: 182
Before SplitterDistance: 225
splitContainer.Panel2MinSize = 205;
After Panel2MinSize: 205
After Panel2Height: 221
After Panel2Width: 182
After SplitterDistance: 225
SplitterDistance remains unchanged and the size of Panel2 is preserved.
Test methodology
Accessibility testing
Test environment(s)
Microsoft Reviewers: Open in CodeFlow