WPF滚动条未滚动

本文关键字:滚动 滚动条 WPF | 更新日期: 2023-09-27 18:29:38

我在文本框中应用了滚动条。它显示滚动条,但不垂直移动文本。我哪里做错了?

代码

  <TextBox x:Name="com" ScrollViewer.VerticalScrollBarVisibility="Auto"  ScrollViewer.CanContentScroll="True" FontSize="20" IsEnabled="False"   Background="{StaticResource img}"  HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Height="151" Grid.RowSpan="2" Width="1050" />

WPF滚动条未滚动

尝试添加ScrollViewer.HorizontalScrollBarVisibility="Disabled"并设置IsEnabled=True