【发布时间】:2012-08-04 12:05:41
【问题描述】:
我在网格中放置了以下列表框控件,但列表框无法正确水平滚动。如果您将滚动条拖到它上面可以正常工作,但是如果您单击箭头,它只会滚动到一半。如何解决此问题?
<Page
x:Class="App5.MainPage"
IsTabStop="false"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App5"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<ListBox Height="400" Width="200"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollMode="Auto">
<ListBoxItem Content="This is my horizontal test # 1" />
<ListBoxItem Content="This is my second horizontal test which spams across" />
</ListBox>
</Grid>
</Page>
谢谢
【问题讨论】:
-
你的 ListBox 上有什么项目吗?
-
是的,我以编程方式将项目添加到列表框中。如果我拖动滚动条,滚动效果很好。
标签: c# .net microsoft-metro windows-runtime winrt-xaml