开发者

special character wpf

开发者 https://www.devze.com 2022-12-15 13:42 出处:网络
a simple WPF question. I would like to have a button with content=\"<\" (the \"backward button\") 开发者_C百科How to I achieve this because the following is wrong:

a simple WPF question. I would like to have a button with content="<" (the "backward button") 开发者_C百科How to I achieve this because the following is wrong:

Content="<"


<Button Content="&lt;"/>

Remember that XAML is still XML, so the same escapes apply.

This is also what the compiler tells you in that case, at least it does for me:

The open angle bracket character '<' is not valid in an attribute. It should be written as '&lt;'.


try this :

Content = "&lt;"


this article should help, basically you need to use

    <Button Content="&lt;" />


if you search a list of this codes, they are alled ISO codes

0

精彩评论

暂无评论...
验证码 换一张
取 消