fundbta.blogg.se

What is subscript and superscript in word
What is subscript and superscript in word







what is subscript and superscript in word

PS - You can also just copy the characters from the Character Map window and paste them into a string in your code. Here you can see the result of the example above. Private Sub Form1_Paint(sender As Object, e As PaintEventArgs) Handles Me.PaintĮ.Graphics.DrawString(MySubAndSuperScriptString, MyFont12, Brushes.Black, 12, 12) RichTextBox1.Text = MySubAndSuperScriptString TextBox1.Text = MySubAndSuperScriptString MySubAndSuperScriptString = "X" & ChrW(SuperScript.n2) & " X" & ChrW(SubScript.n5) 'Using the (Segoe UI) font, this string will display (X² X₅) Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private MyFont8 As New Font("Segoe UI", 8.75, FontStyle.Regular) Private MyFont12 As New Font("Segoe UI", 12, FontStyle.Bold) Private MySubAndSuperScriptString As String = "" Here is an example of setting the controls Fonts to 'Segoe UI' and adding the unicode characters to show sub and super script in the text, plus painting it too. This is the Windows Character Map window. Then you can use these characters in your controls using theĬhrW method to get the unicode characters. You basically just replace the 'U+' with '&H'. SuperScript enum, you see the value of n0 is ' &H2070'. I declared these values in two enumerations but, you can declare them individually if you want. You can declare that in your VB code by using the hexadecimal indicator Notice in the image below that the value for the SuperScript 0 shows ' U+2070'.

what is subscript and superscript in word

For example, I selected the ' Segoe UI' font and found the hexadecimal value for sub and super script numbers 0 through 9.

what is subscript and superscript in word

You just need to open the windows (Character Map), search and select a font that you likeĪnd has the sub and super script characters you want. Actually you can display subscrip or superscript in any control, Label, TextBox, RichTextBox, or even in the Paint event.









What is subscript and superscript in word