Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Servicing) Resume invocation of OnParentHandleRecreated for child control when form recreates handle #6115

Conversation

RussKie
Copy link
Member

@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 5.0.13 milestone Nov 3, 2021
@RussKie RussKie requested a review from a team as a code owner November 3, 2021 06:45
@ghost ghost assigned RussKie Nov 3, 2021
@RussKie RussKie marked this pull request as draft November 4, 2021 01:14
@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
@dreddy-work
Copy link
Member

@RussKie FYI - 3.1/5.0 branches are open for check-ins.

…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_recreated5 branch from ec704db to 3a203b5 Compare November 4, 2021 22:30
@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:34
@RussKie RussKie merged commit 04502c6 into dotnet:release/5.0 Nov 5, 2021
@RussKie RussKie deleted the fix_6093_children_controls_not_rendered_when_parent_recreated5 branch November 5, 2021 01:37
@IDEExperienceTestSolution
Copy link
Member

Verified with .NET SDK 5.0.211 & 5.0.405 builds, this issue was fixed.
Fixed

@ghost ghost locked as resolved and limited conversation to collaborators Feb 19, 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.
4 participants