今天想让Textbook在内容越界的时候显示滚动条,找了半天属性没有找到。原来与Border一样,滚动条也是作为一个单独的附件加上的,呵呵,有趣。显示上下左右滚动条的方法:
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto"
Source Code
<ScrollViewer Height="300" MinWidth="360">
<ScrollViewer.Content>
<TextBlock Name="txtMessages" Text="Messages" />
</ScrollViewer.Content>
</ScrollViewer>