gpt4 book ai didi

wpf - XAML - 文本框换行

转载 作者:行者123 更新时间:2023-12-03 14:45:16 25 4
gpt4 key购买 nike

这个问题在这里已经有了答案:




12 年前关闭。




无论如何,XAML 中是否只有在 TextBox 中有一个换行符?

我知道我可以在代码中设置 myTextBox.Text = "something\r\nsomething2",但我不能这样做:

<TextBox x:Name="myTextBox">
<TextBox.Text>
Something
<Linebreak/>
Something2
</TextBox.Text>
</TextBox>

或这个
<TextBox x:Name="myTextBox" Text="something\r\nsomething2" />

最佳答案

试用...

<TextBox x:Name="myTextBox" Text="something1&#x0a;something2" />

找到 here

关于wpf - XAML - 文本框换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/223615/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com