Wrap it in a scroll viewer:
<ScrollViewer>
<TextBlock />
</ScrollViewer>
NOTE this answer applies to a TextBlock
(a read-only text element) as asked for in the original question.
If you want to show scroll bars in a TextBox
(an editable text element) then use the ScrollViewer
attached properties:
<TextBox ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto" />
Valid values for these two properties are Disabled
, Auto
, Hidden
and Visible
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…