I have a Label that looks the following:
<Label Name="FalsePositiveInput" Content="✓">
This works but how can I do it in the code-behind? I tried this but obviously it's not working:
FalsePositiveInput.Content = "✓";
The character i want to display is a check mark symbol
Use a unicode escape sequence, rather than a character entity:
FalsePositiveInput.Content = "\u2713";
+1 for 一二三
Just one remark: If you want to use extended Unicode, you need to use not \u
, but \U
and 8 characters, e.g. to display left-pointing magnifying glass (1F50D http://www.fileformat.info/info/unicode/char/1f50d/index.htm) you need to use:
this.MyLabel.Text = "\U0001F50D";
Alternatively as was suggested you can paste right into your source code and then you don't need comments like "//it is a magnifying glass"
, but then you will have to save your source code in Unicode, which is probably not what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With