日期:2014-05-18  浏览次数:20881 次

为什么WPF的TextBlock的滚动条不成功?下面这代码有什么问题吗?
XML code

<Window x:Class="test.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" FontSize="50">
    <Grid>
        <TextBlock TextWrapping="Wrap"
                   ScrollViewer.VerticalScrollBarVisibility="Auto">
        abcdefghijklmnopaaaa aaabbbbbbb ccccccccc cdddddddeeeeeeeeefffffffffggggggggghhhh
        </TextBlock>
    </Grid>
</Window>



------解决方案--------------------
外面套个ScrollViewer