views:

74

answers:

1

How can I programatically determine the width or height of a Scrollbar in the ScrollViewer? Not the current size based on the current state of the ScrollViewer (since I can simply test the visibility of the scrollbar and calculate against the ViewerPortWidth/Height and the ScrollViewer ActualWidth/Height).

I need to know what size the Scrollbar's could be based on the templated width. The default is 18 (with a margin of -1). But we all know what could happen if I use the magic number of 18 in my calculations. Some of my users could template the Scrollbars in the ScrollViewer then I'd be screwed.

Thanks!

+1  A: 

Duplicate question: You can use SystemParameters.ScrollWidth.

metao