Setting the Scrollbar Thumb size

后端 未结 5 1275
醉梦人生
醉梦人生 2021-02-05 17:01

I am attempting to work out the algorithm associated with sizing of the WPF Scrollbar thumb element.

The thumb element can be sized using the Scrollbar.ViewportSi

5条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-05 17:17

    If you're looking for how to set a minimum height for the scrollbar thumb:

    From Ian (da real MVP) here:

    scrollBar1.Track.ViewportSize = double.NaN;  
    scrollBar1.Track.Thumb.Height = Math.Max(minThumbHeight, DataScrollBar.Track.Thumb.ActualHeight);
    

    Or you know, add 100+ lines of xaml code cause omgDATABINDING!!1!

提交回复
热议问题