任何人都知道为什么我不能用 Grid 滚动我的 ListBox 吗?我发现只有添加此属性: ScrollViewer.VerticalScrollBarVisibility="Auto" 但在我的应用程序中这不起作用
这是我的 xaml 代码:
<ListBox Height="776" ScrollViewer.VerticalScrollBarVisibility="Auto" MaxHeight="776" Margin="11,12,0,0" Name="listBox1" Width="469">
<ListBox>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Grid.Column="0" Width="200" Grid.Row="0" Source="/a;component/texture.png" />
<Image Grid.Column="0" Width="200" Grid.Row="1" Source="/a;component/texture.png" />
<Image Grid.Column="0" Width="200" Grid.Row="2" Source="/a;component/texture.png" />
<Image Grid.Column="0" Width="200" Grid.Row="3" Source="/a;component/texture.png" />
<Image Grid.Column="0" Width="200" Grid.Row="4" Source="/a;component/texture.png" />
<Image Grid.Column="0" Width="200" Grid.Row="5" Source="/a;component/texture.png" />
<Image Grid.Column="0" Width="200" Grid.Row="6" Source="/a;component/texture.png" />
<Image Grid.Column="1" Width="200" Grid.Row="0" Source="/a;component/texture.png" />
</Grid>
</ListBox>
</ListBox>
感谢您的任何建议;)