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

Fix FlatStyle drawing of ComboBox #6505

Merged
merged 1 commit into from
Jan 18, 2022
Merged

Fix FlatStyle drawing of ComboBox #6505

merged 1 commit into from
Jan 18, 2022

Conversation

jbhensley
Copy link
Contributor

@jbhensley jbhensley commented Jan 14, 2022

Fixes #6494

Proposed changes

ComboBox.FlatComboAdapter.ValidateOwnerDrawRegions contained a bug in its initial null check that prevented the method from executing. This bug existed under Framework 4.8 (and possibly quite earlier):

https://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/ComboBox.cs,6102

The bug was fixed in #6300, which resulted in a regression when drawing a ComboBox with FlatStyle.Flat or FlatStyle.Popup.

While the stated purpose of ValidateOwnerDrawRegions was to reduce screen flicker, the fact remains that the method never actually executed and allowing it to execute now is causing problems. This PR fixes the issue by just removing the method altogether.

Customer Impact

ComboBox will draw itself correctly again.

Regression?

  • Yes

Risk

Screenshots

Before

Reference #6494 to see example of issue prior to fix

After

Screenshot taken after removal of ValidateOwnerDrawRegions

image

Test methodology

  • Manual testing
Microsoft Reviewers: Open in CodeFlow

@jbhensley jbhensley requested a review from a team as a code owner January 14, 2022 14:23
@ghost ghost assigned jbhensley Jan 14, 2022
Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

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

The reasoning is sound.

@RussKie RussKie added the waiting-on-team This work item needs to be discussed with team or is waiting on team action in order to proceed label Jan 18, 2022
@RussKie RussKie removed the waiting-on-team This work item needs to be discussed with team or is waiting on team action in order to proceed label Jan 18, 2022
@RussKie RussKie merged commit 40dd779 into dotnet:main Jan 18, 2022
@ghost ghost added this to the 7.0 Preview1 milestone Jan 18, 2022
@RussKie
Copy link
Member

RussKie commented Jan 18, 2022

Thank you

@jbhensley jbhensley deleted the 6494 branch January 18, 2022 13:01
@ghost ghost locked as resolved and limited conversation to collaborators Feb 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The dropdown button is no visible in ComboBox control when set FlatStyle property to Flat or Popup
3 participants