Closed EVA-SS closed 8 months ago
Call Invalidate()
after the call to DwmSetWindowAttribute
.
https://stackoverflow.com/a/62811758
EDIT: unsure if that will actually help.
We are unable to change the background color of scrollbars. This is an area that we're looking at for the theming and seeing if we can get a solution in the future. For now, this is a known issue.
😭Alright, this is pretty frustrating, I'm really hoping to get some good news from you guys.
@EVA-SS I'd encourage you to investigate a solution if you have the time and ability. Especially if this is blocking you and your app.
This looks promising!
The WM_CTLCOLORSCROLLBAR message is used only by child scroll bar controls. Scrollbars attached to a window (WS_SCROLL and WS_VSCROLL) do not generate this message. To customize the appearance of scrollbars attached to a window, use the flat scroll bar functions.
And disappointment:
Flat scroll bars are supported by Comctl32.dll versions 4.71 through 5.82. Comctl32.dll versions 6.00 and later do not support flat scroll bars.
This looks promising!
The WM_CTLCOLORSCROLLBAR message is used only by child scroll bar controls. Scrollbars attached to a window (WS_SCROLL and WS_VSCROLL) do not generate this message. To customize the appearance of scrollbars attached to a window, use the flat scroll bar functions.
- https://learn.microsoft.com/en-us/windows/win32/controls/wm-ctlcolorscrollbar
- https://learn.microsoft.com/en-us/windows/win32/controls/flat-scroll-bars
- https://learn.microsoft.com/en-us/windows/win32/api/commctrl/nf-commctrl-flatsb_setscrollprop
And disappointment:
Flat scroll bars are supported by Comctl32.dll versions 4.71 through 5.82. Comctl32.dll versions 6.00 and later do not support flat scroll bars.
🙂 Thank you for bringing up the idea, FlatSB can indeed change the scrollbar style. As you pointed out, there are some issues with it, and it's not perfect. overriding the native scrollbar is a challenging task indeed.
Maybe its something that can be done using VisualStyles and the ScrollBarRenderer
?
@EVA-SS Are you happy for me to close this issue in favor of those issues?
okay
.NET version
.net6.0
Did it work in .NET Framework?
Yes
Did it work in any of the earlier releases of .NET Core or .NET 5+?
all
Issue description
After enabling dark mode, the scroll bar remains in the light theme.
DarkTest.zip
Steps to reproduce
After invoking "Dark=true", the scroll bar color remains in the light theme.