2
4

3 回答 3

3

使用 SUP 标签。

lblAmount.Text = Amount & "<sup>€&lt;/sup>"
于 2010-01-01T20:37:30.120 回答
1

您可以通过添加样式属性或添加类(并在样式标签或 css 文件中添加样式)来做到这一点。

<asp:Label id="lblAmount" runat="server"></asp:Label><asp:Label id="lblAmountSymbol" runat="server" CssClass="yourclass"></asp:Label>

span.yourclass {
    font-size:9px; 
    vertical-align:top; 
}

或者

<asp:Label id="lblAmount" runat="server"></asp:Label><asp:Label id="lblAmountSymbol" runat="server"></asp:Label>

而这个,在你的代码文件中

Me. lblAmount.Style.Add(HtmlTextWriterStyle.FontSize, "9px")
Me. lblAmount.Style.Add(HtmlTextWriterStyle.VerticalAlign, "top")

您还可以使用 html 等效的 sup:

Me. lblAmount.Text = Amount & " <sup>€&lt;/sup>"
于 2010-01-01T20:41:39.110 回答
0
Goto Start->Programs->Accessories->System tools->Character Map
Now select this Character ² from the Characters listed.
Click Select
Click Copy

Then try to change the text of any control by pasting this Character in the Lable or Button Caption at Properties.

Even you can wrting code also like this:
Code\Button1.Text = "mm ²"\Code

This is working fine with me.
于 2010-01-01T20:42:39.997 回答