I write windows application using C# and .NET2.0. In RichTextBox I would like to show Celsius symbol. How to do it? Is it possible?
+5
A:
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).
Fredrik Mörk
2009-10-08 07:27:36
Yes - I mean degree symbol. Thanks
mykhaylo
2009-10-08 07:35:26
+1
A:
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.
Julien Lebosquain
2009-10-08 07:27:48
+2
A:
Do you mean °C? You get ° from the keyboard as ALT + 0176 on the numeric keypad.
Mike Two
2009-10-08 07:28:52
+2
A:
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
.)
binarycoder
2009-10-10 21:53:04