How to display up and down objects in Silverlight

Source: Internet
Author: User

1. When you need to display superscripts or subscripts (for example, water's chemical formula H2O) in Silverlight, we can use special characters to display up and down targets specially handled by Silverlight.

Special characters of the superscript:

Superscript:

0: U+ 2070

1: U + 00b9

2: U + 00b2

3: U + 00b3

4-9: U + 2074-2079 (special characters from 4 to 9)

+: U + 207a

-: U + 207b

=: U + 207c

(: U + 207d

): U + 207e

N: U + 207f

Special characters of the following mark:

0-9: U + 2080-2089 (special characters from 0 to 9)

+: U + 208a

-: U + 208b

=: U + 208c

(: U + 208d

): U + 208e

In the preceding special characters, the content before the colon is what we want to display, and the special character after the colon is how to display in Silverlight;

In the code, u uses "\ x". For example, subscript 2 is represented by "\ x2082.

2. Use the following method:

When the chemical formula of water is displayed, the displayed string is: String water = "H" + "\ x2082" + "O ";

The actual string for displaying the stock theorem is: String S = "A \ x00b2 + B \ x00b2 = C \ x00b2 ";

The special character string "\ x2082" is displayed as the subscript 2, and the special character string "\ x00b2" is displayed as the subscript 2"

3. The display in the control is as follows:

<Textblock horizontalalignment = "Left" margin = "0" name = "MSG" text = "textblock" verticalalignment = "TOP"/>

Background code:

MSG. Text = "Fe \ x2082o \ x00b3"; (display the chemical formula of iron oxide)

Interface display effect:

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.