如何创建一个控件,其中包含垂直列出的项目中的项目,但仅限于控件的高度,然后从第二列的顶部开始?
有点像 Windows 资源管理器的外观和感觉。
我现在正在使用 a WrapPanel
,但我不知道如何让它水平滚动......
非常感谢这里的任何帮助
干杯,马克
如何创建一个控件,其中包含垂直列出的项目中的项目,但仅限于控件的高度,然后从第二列的顶部开始?
有点像 Windows 资源管理器的外观和感觉。
我现在正在使用 a WrapPanel
,但我不知道如何让它水平滚动......
非常感谢这里的任何帮助
干杯,马克
将WrapPanel
具有垂直方向的 aScrollViewer
包含在VerticalScrollbarVisibility
设置为的 a 中Disabled
。
将其粘贴到 Kaxaml 中,您将看到:
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Page.Resources>
<Style TargetType="{x:Type Button}">
<Style.Setters>
<Setter Property="Width" Value="50"/>
<Setter Property="Height" Value="50"/>
</Style.Setters>
</Style>
</Page.Resources>
<Grid Margin="200, 100">
<ScrollViewer VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Visible" MaxWidth="200">
<WrapPanel Orientation="Vertical">
<Button/>
<Button/>
<Button/>
<Button/>
<Button/>
<Button/>
<Button/>
<Button/>
<Button/>
</WrapPanel>
</ScrollViewer>
</Grid>
</Page>
听起来很像 UniformGrid 或 WrapPanel 对我来说检查这个博客,他有一些很好的内置布局面板演示