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
I work on a Visual Studio extension.
I have been testing the extension on version 17.13 of Visual Studio with .NET Framework version 4.8
I have a custom WinForms ComboBox which I repaint by intercepting WM_PAINT in WndProc.
I first call base.WndProc.
Then I paint the background, border and dropdown button, and when the ComboBox is not editable, I also paint the text.
I also handle OnMouseEnter and OnMouseLeave, but I merely set a private '_isHovered' variable and then call the base function, and I do not call Invalidate()
I am also intercepting wm_ctlcoloredit and wm_ctlcolorstatic, but those do not seem related to this.
On Windows 10, the control works reasonably well and there is no flickering.
On Windows 11, when I hover over the control, it flickers a fair amount, especially when I hover back and forth near the dropdown button.
I have tried the following:
- Intercept wm_erasebkgnd
○ This seems to help a little, but not much.
- Set UserPaint, OptimizedDoubleBuffer, AllPaintingInWmPaint
○ This did not seem to help, and I also seem unable/do not know how to render the text correctly for an editable ComboBox
- Override CreateParams and set ws_ex_composited
○ I did this in the custom ComboBox itself, not the form, because it is just the specific hovered control that is flickering
○ This causes an unknown error
I have tried some other small changes too.
Do you have any advice/know what might be causing this issue?
Also, I see this issue: #12739
but it does not seem entirely relevant.
Thanks.
The text was updated successfully, but these errors were encountered:
I work on a Visual Studio extension.
I have been testing the extension on version 17.13 of Visual Studio with .NET Framework version 4.8
I have a custom WinForms ComboBox which I repaint by intercepting WM_PAINT in WndProc.
I first call base.WndProc.
Then I paint the background, border and dropdown button, and when the ComboBox is not editable, I also paint the text.
I also handle OnMouseEnter and OnMouseLeave, but I merely set a private '_isHovered' variable and then call the base function, and I do not call Invalidate()
I am also intercepting wm_ctlcoloredit and wm_ctlcolorstatic, but those do not seem related to this.
On Windows 10, the control works reasonably well and there is no flickering.
On Windows 11, when I hover over the control, it flickers a fair amount, especially when I hover back and forth near the dropdown button.
I have tried the following:
- Intercept wm_erasebkgnd
○ This seems to help a little, but not much.
- Set UserPaint, OptimizedDoubleBuffer, AllPaintingInWmPaint
○ This did not seem to help, and I also seem unable/do not know how to render the text correctly for an editable ComboBox
- Override CreateParams and set ws_ex_composited
○ I did this in the custom ComboBox itself, not the form, because it is just the specific hovered control that is flickering
○ This causes an unknown error
I have tried some other small changes too.
Do you have any advice/know what might be causing this issue?
Also, I see this issue: #12739
but it does not seem entirely relevant.
Thanks.
The text was updated successfully, but these errors were encountered: