Vertical text on a button

witzulu

Member
Joined
Jul 3, 2004
Messages
20
Programming Experience
3-5
Hi

I would like to write text verticaly on a button? It must not hoever be on leter below each other like this

B
U
T
T
O
N

but more like the style visual studio use for the bars on the side that autohide?
 

Rohito

New member
Joined
Jun 26, 2005
Messages
4
Location
India
Programming Experience
5-10
Handle the button's paint event.

Use the graphic object's RotateTransform to rotate the canvas and DrawString away!

Cheers
Rohit
 

kulrom

Well-known member
Joined
May 10, 2005
Messages
2,854
Location
Republic of Macedonia
Programming Experience
10+
Hi,
First off, Rohit welcome to the forum ;) I hope you will spend your time on this website with a pleasure.

Witzulu, as Rohit gave you a good point all that I can do here is to provide a code by his scenario.

just a rough code:
PHP:
PrivateSub Button1_Paint(ByVal sender AsObject, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Button1.Paint
 
e.Graphics.TranslateTransform(25, 30)
 
e.Graphics.RotateTransform(90)
 
e.Graphics.DrawString("Solution Explorer", Me.Font, Brushes.Blue, 0, 0)
 
EndSub


Also you can take a look at the attachment and see code at work in deeds of ... Cheers ;)
 

Attachments

  • RotateVerticaltext.zip
    21.9 KB · Views: 60
Top Bottom