Vertical text

K

Ken Hunt

I know how to draw text vertically. My problem is the
StringFormatFlags.DirectionVertical command rotates the text 90 degrees
clockwise. I want it rotated 90 degrees counter-clockwise (I'm making a
y-axis label for a chart). How do you do that? Can you do that??

Ken
 
H

Herfried K. Wagner [MVP]

* "Ken Hunt said:
I know how to draw text vertically. My problem is the
StringFormatFlags.DirectionVertical command rotates the text 90 degrees
clockwise. I want it rotated 90 degrees counter-clockwise (I'm making a
y-axis label for a chart). How do you do that? Can you do that??

Untested:

\\\
Private Sub Form1_Paint( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.PaintEventArgs _
) Handles MyBase.Paint
e.Graphics.RotateTransform(270)
e.Graphics.DrawString("Hello World!", Me.Font, Brushes.Blue, 0, 0)
End Sub
///
 
K

Ken Tucker [MVP]

Hi,

Dim s As String = "Strings at any angle"

e.Graphics.TranslateTransform(20, Me.ClientSize.Height - 20)
e.Graphics.RotateTransform(270)
e.Graphics.DrawString(s, Font, Brushes.Black, 50, 0,
StringFormat.GenericTypographic)


Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

vertical orientation caption in a label 3
Display on its side 3
Vertical Property 1
Vertical Text - FP 2003 1
Vertical text 4
Rotating or Vertical Text? 7
StringFormatFlags.DirectionVertical 1
Vertical Text 6

Top