How to find Vertical Scrollbar width of a Scrollviewer in C# How to find Vertical Scrollbar width of a Scrollviewer in C# wpf wpf

How to find Vertical Scrollbar width of a Scrollviewer in C#


I am not sure if this is the correct answer. Every WPF control can be restyled so even the scrollbar. So SystemParameters.VerticalScrollBarWidth works only if it is used as default scrollbar. The correct solution would be to find the vertical scrollbar in the visual tree and measure it's ActualWidth. It is the most precise measurement.