C
Christian O'Connell
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
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