如何在标签上添加加号减号

时间:2013-07-27 10:33:25

标签: c# asp.net unicode

这里我的要求是将+和 - 分配给一个数字,同时指向标签中的数字,如c#asp.net中的下图所示!

enter image description here

3 个答案:

答案 0 :(得分:12)

使用unicode字符"PLUS-MINUS SIGN"

其代码点为(U+00B1)

答案 1 :(得分:7)

label.Text = "\u00B1"

Unicode字符Plus-Minus-Sign的代码为00B1,C#中的unicode转义序列为\ u后跟4个十六进制数字。

答案 2 :(得分:0)

您可以添加另外两个带有其他字体大小的标签和一个Click-Event来向上或向下计数。

    private void minus_Click(object sender, EventArgs e)
    {
        this.number.Text = Convert.ToInt32(this.number.Text) - 1 + "";
    }

    private void plus_Click(object sender, EventArgs e)
    {
        this.number.Text = Convert.ToInt32(this.number.Text) + 1 + "";
    }

其中“number”是你的编号。

相关问题