-
Notifications
You must be signed in to change notification settings - Fork 992
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
Reset MouseIsOver when the control loses focus #12598
base: main
Are you sure you want to change the base?
Reset MouseIsOver when the control loses focus #12598
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12598 +/- ##
===================================================
+ Coverage 75.73242% 76.03698% +0.30455%
===================================================
Files 3153 3164 +11
Lines 635807 639335 +3528
Branches 46975 47188 +213
===================================================
+ Hits 481512 486131 +4619
+ Misses 150870 149697 -1173
- Partials 3425 3507 +82
Flags with carried forward coverage won't be shown. Click here to find out more. |
src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ComboBoxTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ComboBoxTests.cs
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.cs
Show resolved
Hide resolved
The first repair idea is changing Therefore, when changing the property value while the mouse is hovering, the control must be drawn in its basic form before drawing the black border of the Popup. So I redrawn the DropDown button when executing DrawPopUpCombo in the latest commit This inevitably causes the DropDown button to flicker when the cursor moves between the DropDown button and the edit box @Tanya-Solyanik Do you have other suggestions? |
Fixes #12590
Root Cause
In order to fix the flickering issue#2053861, we modified the drawing logic of ComboBox in #11529
When
FlatStyle == FlatStyle.Popup
and the control gets the focus or the mouse entering, draw the black border of the popup instead of re-rendering the entire controlThis leads to the current issue. When the drop-down box is expanded by the mouse, and the focus is moved to the property page using Tab, FlatStyle is changed to popup, and then the RightToLeft property is modified
At this time, the conditions for drawing the Popup border are met (i.e. FlatStyle == FlatStyle.Popup and MouseIsOver=true), which causes DrawFlatCombo not to be executed
Proposed changes
Customer Impact
Regression?
Risk
Screenshots
Before
When change the RightToLeft property after expanding the Popup FlatStyle comboBox, the dropdown button on the comboBox disappeared
After
The dropdown button on the comboBox can be show normally
Test methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow