gpt4 book ai didi

c# - 在 wpf 中用 < 字符重命名按钮

转载 作者:太空狗 更新时间:2023-10-30 00:19:24 25 4
gpt4 key购买 nike

我有一个 WPF 应用程序,我在其中尝试重命名这样的按钮 << Précédent

<Button Content="Suivant >>" Background="#FFF9F7F7" Margin="0,0,100,8"
HorizontalAlignment="Right" Width="75" Height="22" VerticalAlignment="Bottom"
RenderTransformOrigin="0.5,0" BorderBrush="CadetBlue" BorderThickness="2" />
<Button Content="<< Précédent" Background="White" Margin="0,0,180,8"
HorizontalAlignment="Right" Width="75" Height="22" VerticalAlignment="Bottom"
BorderBrush="CadetBlue" BorderThickness="2" />

但是第二个按钮名称出现错误

  1. 为什么这行不通?
  2. 我该如何解决?

最佳答案

我怀疑这只是 < 的 XML 转义问题,因为你不能使用 <直接在属性值中。尝试:

<Button Content="&lt;&lt; Précédent" ...>

...请在您的下一个问题中提供更多详细信息。

(您也需要对 XML 内容进行相同的转义,否则它将被视为新元素的开始。)

关于c# - 在 wpf 中用 < 字符重命名按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21236923/

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