我正在使用WPF TextBlock,但是当文本太长时,文本会被切断.是否有AutoScroll功能?

Ser*_*pia 5 c# wpf textblock

我的TextBlock有50x50像素来显示文本,但是如果有更多文本,我希望用户能够滚动.此控件是否有自动滚动功能?

我应该使用更适合此任务的不同控件吗?

这里有几个图片来说明问题:

这个工作正常,因为文本适合: 替代文字

这个似乎不正确.文字被切断了. 替代文字

Ser*_*pia 7

以防有人遇到同样的问题.只需用控件包装textBlock即可.奇迹般有效!

<ScrollViewer Background="Black">
    <TextBlock x:Name="textBlockBackStory" 
               FontSize="12" 
               Foreground="Orange" 
               TextWrapping="Wrap"                       
               Background="Black" 
               TextDecorations="None">
                            Backstory here.
    </TextBlock>      
</ScrollViewer>
Run Code Online (Sandbox Code Playgroud)