Celsius symbol in RichTextBox
I write windows application using C# and .NET2.0. In RichTextBox I would lik开发者_JAVA技巧e to show Celsius symbol. How to do it? Is it possible?
Do you mean Celsius symbol as in 37°C
? If so you can simply put that character where it should be, I guess:
richTextBox.Text = string.Format("{0}°C", degrees);
If you are looking for character codes (or just want to find character to copy/paste them), you can use the Character Map application in Windows (in Start -> Programs -> Accessories -> System Tools).
Do you mean °C? You get ° from the keyboard as ALT + 0176 on the numeric keypad.
If you are wary of embedding a non-ASCII character in your source code, you could use the following instead:
richTextBox.Text = string.Format("{0}\u00B0C", degrees);
(B0
is the hexadecimal for 176
.)
richTextBox1.Text = "°"
will display a degree symbol in a rich textbox but I'm pretty sure you want something else. Please rephrase your question if that's the case.
° //html entity.
精彩评论