Setting the Scrollbar Thumb size

后端 未结 5 1117
醉梦人生
醉梦人生 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:23

    From: http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.track(VS.90).aspx

    thumbSize = (viewportSize/(maximum–minimum+viewportSize))×trackLength

    or re-arranging for viewportSize:

    viewportSize = thumbSize×(maximum-minimum)/(trackLength-thumbSize)

    You've prob found this already but thought I'd post in case others end up here.

提交回复
热议问题