You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Weird display when hovering to ToolStripComboBox drop down arrow #11760
9.0.100-preview.7.24371.4 with dlls built from winforms repo of main branch. It cannot be reproduced with .NET SDK.
Did it work in .NET Framework?
No
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Yes, this is a regression issue. Not reproduce on .NET 8.0
Issue description
When hovering over drop-down arrow of ToolStripComboBox, an additional blue hover effect appears outside the icon. This issue can only be reproduced with ToolStripComboBox which is in ContextMenuStrip, ToolStrip, MenuStrip. The issue cannot be reproduced with normal ComboBox.
ToolStripComboBox.mp4
Steps to reproduce
Create a WinForms .NET 9.0 project.
Add a ToolStrip component to the form.
Click the drop-down arrow on the ToolStrip to open the list of available items.
Choose ComboBox from the list to add it to the ToolStrip.
Build and run project.
Hover to drop-down arrow of the ToolStripComboBox and observe the result.
In order to make the combo button look thinner, ToolStripComboBox was redrawn based on the original ComboBox. The original button was drawn in two parts (_dropDownRect and _whiteFillRect), and PR #11529 canceled the redrawing of the entire comboBox when the mouse hovered to solve the flickering problem, which caused this problem.
There are two solutions
When the target control is ToolStripComboBox, revert the changes of PR Issue 2053861 fix combo box flickering issue #11529, but this will redraw the entire comboBox when the mouse hovers, it will cause flickering.
No longer redraw the ToolStripComboBox, so that its appearance is consistent with the normal ComboBox
I submitted a PR #11761, commit1 adopted solution 1, and commit2 adopted solution 2
What modification do you think is more appropriate? Please give me some suggestions
@LeafShi1 - changing width of the DropDown button in ToolStripComboBox will be a breaking change as it will leave less room for the content and somebody's text will get truncated. Unfortunately we should partially revert the "flickering fix", i.e. go with commit 1
Activity
Olina-Zhang commentedon Jul 26, 2024
Give a screenshot of expected result and actual result:

LeafShi1 commentedon Jul 26, 2024
In order to make the combo button look thinner, ToolStripComboBox was redrawn based on the original ComboBox. The original button was drawn in two parts (_dropDownRect and _whiteFillRect), and PR #11529 canceled the redrawing of the entire comboBox when the mouse hovered to solve the flickering problem, which caused this problem.
There are two solutions
When the target control is ToolStripComboBox, revert the changes of PR Issue 2053861 fix combo box flickering issue #11529, but this will redraw the entire comboBox when the mouse hovers, it will cause flickering.

No longer redraw the ToolStripComboBox, so that its appearance is consistent with the normal ComboBox

I submitted a PR #11761, commit1 adopted solution 1, and commit2 adopted solution 2
What modification do you think is more appropriate? Please give me some suggestions
@Tanya-Solyanik
Tanya-Solyanik commentedon Jul 26, 2024
@LeafShi1 - changing width of the DropDown button in ToolStripComboBox will be a breaking change as it will leave less room for the content and somebody's text will get truncated. Unfortunately we should partially revert the "flickering fix", i.e. go with commit 1
Philip-Wang01 commentedon Aug 8, 2024
Verified this issue in the latest .NET 9.0.100-rc.1.24407.33, it was fixed: No additional blue hover effect appears outside the icon.
test11760.mp4
Nora-Zhou01 commentedon Aug 26, 2024
Verified the issue with .NET 9.0.100-rc.1.24422.10 test pass build that the issue has been fixed, which have the same results as above.