【发布时间】:2017-02-13 17:10:45
【问题描述】:
我已经为此奋斗了几个小时。它已经让我丧命了,我为自己感到羞耻:(
我不能让水平滚动条出现在这里。谁能指出我为什么?
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ScrollViewer Grid.Row="0" Grid.Column="0">
<Canvas Width="2000" Height="2000" ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Auto">
<Grid Canvas.Left="30" Canvas.Top="30">
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0">Test text</TextBlock>
</Grid>
<Grid Canvas.Left="430" Canvas.Top="30">
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0">Another test text</TextBlock>
</Grid>
</Canvas>
</ScrollViewer>
</Grid>
垂直滚动条非常完美。
非常感谢您的帮助。
【问题讨论】:
标签: wpf scrollview horizontal-scrolling