日期:2014-05-16  浏览次数:20971 次

WPF,TextBox为什么弄丢了字符串
窗体中有一个TextBox控件:

<Window x:Class="WPF2.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:WPF2"
        Title="MainWindow" Height="350" Width="525" Background="White">
    <Grid>
        <TextBox TextWrapping="Wrap" />
    </Grid>
</Window>


现在把下面这些字符串拷贝到TextBox中去,为什么最后字符串的数量减少了呢?

012,253,128;453 245 012 012,253,128;453 245 012 012,253,128;453 245 012 012,253,128;453 245 012
 012,253,128;453 245 012 012,253,128;453 245 012 012,253,128;453 245 012
 012,253,128;453 245 012
 012,253,128;453 245 012 012,253,128;453 245 012 012,253,128;453 245 012 012,253,128;453 245 012 012,253,128;453 245 012
 012,253,128;453 245 012 012,253,128;453 245 012 012,253,128;453 245 012
 012,253,128;453 245 012




------解决方案--------------------
TextBox.Text="012,253,128;453 245 012 012,253,128;453 .......";
------解决方案--------------------

------解决方案--------------------
前端赋值的话 
&#xD;&#xA;
代表回车换行 
------解决方案--------------------

<TextBox  AcceptsReturn="True"> </TextBox>


加个这个属性试试,应该就好了..