[Q] Unicode characters as Button text

S

Stuart Norris

Hi All,

I am new to csharp and Visual Studio and trying to learn.

I would like to have a button with an up arrow as it "label" instead of text?

Is this possible using the normal button in System.Windows.Forms.Button?

I wish to use Unicode 21E7 from the Arrows Range 2190-21FF.

How do I define the button to use a unicode character as its "label"?

this.button.Text = "";

Thanks

Stuart
 
M

Morten Wennevik

Hi Stuart,

You can write unicode characters as \u####, so in your case

this.button.Text = "\u21E7"; // or \u21e7
 
J

Jon Skeet [C# MVP]

Stuart Norris said:
I am new to csharp and Visual Studio and trying to learn.

I would like to have a button with an up arrow as it "label" instead of text?

Is this possible using the normal button in System.Windows.Forms.Button?

I wish to use Unicode 21E7 from the Arrows Range 2190-21FF.

How do I define the button to use a unicode character as its "label"?

this.button.Text = "";

Well, in theory,

this.button.Text = "\u21e7";

should work, but I don't know if it'll work - it'll depend on whether
the font used for the button contains that character.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top