473,401 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Question: How to making text italic and superscripted

Hello - apologies if this has been asked before and already answered.
This is my first question and I have already unsuccessfully searched
Google groups and the on-line help files for the answer.

Here is what I am doing.

I am modifying a largish VB.Net program to make text appear, in the
quadratic equation, from

0=aX2+bx+c

to:

2
0=aX +bx+c

ie, the 2 is to be superscripted. And I also need to italise the X's.

I can see how to individually italicise a complete string, but not
just parts (that is just the X's). So how is this done (to both make
the 2 superscripted and italicise the X's)?

Here is a code snippet from the application (to get this to work paste
into Form1). I am wanting to somehow still use g.DrawString, if at all
possible because there is a lot of code to modify, but am not sure
what the string is I should use to format the quadratic formula with
the 2 superscripted and the X's italicised. If someone could post a
pointer or two I would be most greatful.

Protected Overrides Sub OnPaint(ByVal vpe As PaintEventArgs)
MyBase.OnPaint(vpe)
Dim g As Graphics = vpe.Graphics
Dim BlackSolidBrush As SolidBrush = New SolidBrush(Color.Black)
Dim YCoord As Single = 100
Dim XCoord As Single = 100
Dim FormulaFont As New Font("Times New Roman", 12, _
FontStyle.Regular, GraphicsUnit.Pixel)
Dim QuadraticEquation As String = "0=aX2+bX+c"
g.DrawString(QuadraticEquation, FormulaFont, _
BlackSolidBrush, xCoord, yCoord)
End Sub
Thanking you all for reading this and your help in advance.
Chris
Nov 20 '05 #1
1 1511
* cd********@hotmail.com (Christian O'Connell) scripsit:
Hello - apologies if this has been asked before and already answered.
This is my first question and I have already unsuccessfully searched
Google groups and the on-line help files for the answer.

Here is what I am doing.

I am modifying a largish VB.Net program to make text appear, in the
quadratic equation, from

0=aX2+bx+c

to:

2
0=aX +bx+c

ie, the 2 is to be superscripted. And I also need to italise the X's.


Maybe you want to use a "ready-to-use" (but commercial) solution:

<http://www.soft4science.com/>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Tmenke | last post by:
Is there a way to superscript a single character in a string for example to show a number raised to a exponent ? Eg lblResult.Caption = " 52 in4 " Where the 4 would be superscripted ? ...
0
by: Rob Tweed | last post by:
Can anyone help on the following XSL-FO questions? What's the best way to respresent sub- and superscripted numbers within chemical formulae and mathematical expressions in XSL-FO (within the...
4
by: Dru | last post by:
Hi, I am making a textarea for people to add/modify their text for descriptions products. I want to have buttons (or just text links) with functions that will allow them to bold, italicize, sup,...
6
by: andreas | last post by:
A selected text has fontstyles like bold and italic and underscore I want to remove one of them without changing the other fontstyles. How to do that? Thanks for any response
20
by: Jukka K. Korpela | last post by:
I recently noticed, once again, how the common implementation of italics can really disturb. I'm referring to the common phenomenon that there is by default too little spacing after italics text,...
18
by: Diogenes | last post by:
Hi All; I, like others, have been frustrated with designing forms that look and flow the same in both IE and Firefox. They simply did not scale the same. I have discovered, to my chagrin,...
0
by: emilnordiclake | last post by:
(C#, Microsoft .NET Framework 3.5) Hello! I'm in the process of creating a custom text control and I want to add functionality for superscripts and subscripts. I'm using TextRenderer for...
4
by: | last post by:
I often see, on certain websites, to the right of link-text, a number or letter inside angle-brackets, and superscripted (or raised slightly). I've never seen anything explaining what these are...
2
by: r_ahimsa_m | last post by:
Hello, I am learning CSS and other WWW technologies. In the folowing definition italic doesn't work: h2 { color: Brown; text-decoration: italic; }
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.