scrollbar wpf 高度

编程入门 行业动态 更新时间:2024-10-08 00:27:58

scrollbar wpf <a href=https://www.elefans.com/category/jswz/34/1765561.html style=高度"/>

scrollbar wpf 高度

如何:自訂 ScrollBar 上捲動方塊的大小How to: Customize the Thumb Size on a ScrollBar

03/30/2017

本文內容

本主題說明如何將設定 Thumb ScrollBar 為固定大小,以及如何指定的最小大小 Thumb ScrollBar 。This topic explains how to set the Thumb of a ScrollBar to a fixed size and how to specify a minimum size for the Thumb of a ScrollBar.

範例Example

描述Description

下列範例 ScrollBar 會建立具有 Thumb 固定大小的。The following example creates a ScrollBar that has a Thumb with a fixed size. The example sets the ViewportSize property of the Thumb to NaN and sets the height of the Thumb. 若要建立 ScrollBar Thumb 具有固定寬度的水準,請設定的寬度 Thumb 。To create a horizontal ScrollBar with a Thumb that has a fixed width, set the width of the Thumb.

程式碼Code

Background="{TemplateBinding Background}"

SnapsToDevicePixels="true">

IsEnabled="{TemplateBinding IsMouseOver}"

Height="18"

Command="ScrollBar.LineUpCommand"

Content="M 0 4 L 8 4 L 4 0 Z" />

ViewportSize="NaN"

IsDirectionReversed="true"

Grid.Row="1"

Grid.ZIndex="-1">

Command="ScrollBar.PageUpCommand"/>

Command="ScrollBar.PageDownCommand"/>

Grid.Row="2"

Style="{StaticResource ScrollBarButton}"

Height="18"

Command="ScrollBar.LineDownCommand"

Content="M 0 0 L 4 4 L 8 0 Z"/>

描述Description

下列範例 ScrollBar 會建立具有 Thumb 最小大小的。The following example creates a ScrollBar that has a Thumb with a minimum size. To create a horizontal ScrollBar with a Thumb that has a minimum width, set the HorizontalScrollBarButtonWidthKey.

程式碼Code

Background="{TemplateBinding Background}"

SnapsToDevicePixels="true">

IsEnabled="{TemplateBinding IsMouseOver}"

Height="18"

Command="ScrollBar.LineUpCommand"

Content="M 0 4 L 8 4 L 4 0 Z" />

IsDirectionReversed="true"

Grid.Row="1"

Grid.ZIndex="-1">

x:Key="{x:Static SystemParameters.VerticalScrollBarButtonHeightKey}">

100

Command="ScrollBar.PageUpCommand"/>

Command="ScrollBar.PageDownCommand"/>

Grid.Row="2"

Style="{StaticResource ScrollBarButton}"

Height="18"

Command="ScrollBar.LineDownCommand"

Content="M 0 0 L 4 4 L 8 0 Z"/>

Property="IsEnabled" Value="false">

Property="Visibility" Value="Hidden"/>

另請參閱See also

更多推荐

scrollbar wpf 高度

本文发布于:2024-02-06 19:42:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1751308.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:高度   scrollbar   wpf

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!