Vertical Text on a Button

  • Thread starter Thread starter Andrew Robinson
  • Start date Start date
A

Andrew Robinson

any simple way to rotate the text on a button to a vertical orientation?

specific examples would be most usefull.

thanks,

-andrew
 
Hi,

It would probably be quite easy to inherit from Button and do the drawing in
an OnPaint override with GDI+. You would have to ensure that the size of the
button matched that of the text, though.

You would need a separate property for the text, and keep the base's Text
property as an empty string so it doesn't display it's own text.

-- Pete
 
Hello,

Andrew Robinson said:
any simple way to rotate the text on a button to a vertical orientation?

This is not supported by the button control directly, nevertheless you can
create an ownerdrawn button (see samples on http://www.codeproject.org/)
that paints the vertical text itself:

\\\
e.Graphics.RotateTransform(90) ' 90 degree.
e.Graphics.DrawString("Hello World!", Me.Font, Brushes.Blue, 100, -100)
///
 
Back
Top