Skip to content

Conversation

@RussKie
Copy link
Contributor

@RussKie RussKie commented Nov 3, 2021

Fixes #6093, the regression introduced in #2262.

Proposed changes

Restore the required state after the handle was re-created.

#2262 has added a check to the method handling recreation of a control handle to verify that the control is created before any child controls can be re-parented on to it.
image

However it was missed that DestroyHandle() method resets the state (i.e. removes Created state), but CreateHandle() method doesn't set the state back.

Customer Impact

  • Child controls sited on a form that recreates its handle while shown (e.g. while changing the value of ShowInTaskbar property) will be correctly rendered.

Regression?

Risk

  • Small

Screenshots

Before

image
On the left ListBox and CheckedListBox controls, on the right ListView controls.

After

image

Test methodology

  • git bisect to establish the commit that regressed the behaviour
  • manual
  • unit tests
Microsoft Reviewers: Open in CodeFlow

@RussKie RussKie added the servicing-consider .NET Shiproom label indicating a PR seeks to enter into a branch under Tell-Mode criteria label Nov 3, 2021
@RussKie RussKie added this to the 6.0.1 milestone Nov 3, 2021
@RussKie RussKie requested a review from a team as a code owner November 3, 2021 06:39
@ghost ghost assigned RussKie Nov 3, 2021
@dreddy-work dreddy-work added the 🚫 * NO-MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) label Nov 3, 2021
@RussKie RussKie marked this pull request as draft November 4, 2021 01:13
@ghost ghost added the draft draft PR label Nov 4, 2021
@leecow leecow added servicing-approved .NET Shiproom approved the PR for merge and removed servicing-consider .NET Shiproom label indicating a PR seeks to enter into a branch under Tell-Mode criteria labels Nov 4, 2021
…orm recreates handle

Fixes dotnet#6093

Fix the regression introduced in dotnet#2262, which added a check to the method
handling recreation of a control handle to verify that the control is
created before any child controls can be re-parented on to it.

However it was missed that DestroyHandle() method resets the state (i.e.
removes Created state), but CreateHandle() method doesn't set the state
back.
@RussKie RussKie force-pushed the fix_6093_children_controls_not_rendered_when_parent_recreated6 branch from eb4bada to 2210a17 Compare November 4, 2021 22:33
@RussKie RussKie removed the draft draft PR label Nov 4, 2021
@RussKie RussKie marked this pull request as ready for review November 4, 2021 22:35
@dreddy-work dreddy-work removed the 🚫 * NO-MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) label Nov 9, 2021
@RussKie RussKie merged commit cae6377 into dotnet:release/6.0 Nov 9, 2021
@RussKie RussKie deleted the fix_6093_children_controls_not_rendered_when_parent_recreated6 branch November 9, 2021 22:17
@ghost ghost locked as resolved and limited conversation to collaborators Jan 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

servicing-approved .NET Shiproom approved the PR for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET 5.0, WinForms: Changing ShowInTaskbar will let CheckedListBox-items disappear.

3 participants