开发者

How to change a ListBox's Vertical Scrollbar's Repeat Button Size in WPF

I have a ListBox control with a vertical scrollbar. I would like to increase the Repeat Buttons' Height to something bigger because our UI is touch-compatible.

Is there a simple way to do it ?

Thank you 开发者_如何转开发and best regards,

Romanin


Easiest is to modify the ControlTemplate for a vertical scrollbar and change it to what you want: ScrollBar ControlTemplate Example


It's not so easy to just change the button sizes, because they are hardcoded in the default template. But you can scale the whole ScrollBar control by a factor. Just put this Style to your Window or Control resources.

<Window.Resources>
   <Style TargetType="ScrollBar">
      <Setter Property="LayoutTransform">
           <Setter.Value>
               <ScaleTransform CenterX="0" CenterY="0"
                               ScaleX="2" ScaleY="2" />
           </Setter.Value>
        </Setter>
   </Style>
</Window.Resources>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜