简体   繁体   中英

How to get scrollbar height in scrollviewer in uwp?

how to get scollbar height in scrollviewer in uwp just like shown in this photo.

在此处输入图像描述

How to get scrollbar height in scrollviewer in uwp?

Please check ScrollBar style( stored in the general.xaml file ), the matched part like above screenshot is VerticalThumb , you could copy the following style in your page resource, and detect VerticalThumb load event, and get the ActualHeight property with following code.

private void VerticalThumb_Loaded(object sender, RoutedEventArgs e)
{
    var verticalThumb = sender as Thumb;

    var height = verticalThumb.ActualHeight;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM