"but technically it is controlled by the content" "I think it is pretty clear that if a page is light, you don't want the scrollbar of, for example, a text box in the middle of the page to use a dark scrollbar, which would likely be very stark." We would also need to think about what should happen for scrollbar in s. If, from product perspective, we think the page scrollbars should follow the browser theme unless the content specify otherwise, I think that's technically possible for majority of cases and still conforming, but it may add complexity to the code. the content can decide what color the scrollbar should be (via scrollbar-color for example).
It feels like it might be part of the browser, so some users might expect it to follow the browser theme, but technically it is controlled by the content, i.e. The situation for the scrollbar of the page is less clear, though. I think it is pretty clear that if a page is light, you don't want the scrollbar of, for example, a text box in the middle of the page to use a dark scrollbar, which would likely be very stark. The content scrollbars are generally considered part of the content, so I would argue that it should follow the content rather than its container (the browser).
I don't think knowing how we paint scrollbars on Windows is important for whether we should consider this a bug at all. more a product question than a technical question). It uses the same idea of changing the opacity within its target style.I guess this is really a question about user expectation (i.e. The WPF slider control's appearance is equally bemusing to alter, and I can provide a style for that too, if anyone is interested.
I would welcome simplifications here if you have any tips. But once you see how the scrollbars are constructed internally, it starts to make sense, and we are lucky that we can restyle them at all.
I admit that even the above code seems bemusing and far too much effort for such a trivial change to the GUI, especially for beginners who already have enough to take in just learning WPF basics. Here is the complete XAML source code for the blue window, above:Ĭopy Code Points of Interest Here are some more examples showing different color saturations and how transparency can help blend in with the background color: You can create a few styles to match your particular circumstances - for example, you probably want thinner scrollbars only within smaller controls, because they are more fiddly to click. The thickness of the scrollbars can also be changed in the same code fragment. And because there is no text in a scrollbar, its appearance does not resemble a "disabled" control.
There are several articles on how to re-style the scrollbars, but all of them seem to require vast quantities of code, and I hate to pollute my code base like that for such a seemingly-trivial task.īy changing the Opacity of the scrollbars, which is a relatively small style change, one can make the scrollbars blend in with the overall background color of the controls on the window. The default appearance of the scrollbars in the WPF ScrollViewer is ugly and gray, and often appears too large and obtrusive when used within a smaller control or dialog.