473,387 Members | 1,606 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,387 software developers and data experts.

Vertical text

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
Nov 20 '05 #1
5 11925
* "Ken Hunt" <yo*@dontneed.this> scripsit:
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
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
In article <#c**************@tk2msftngp13.phx.gbl>, yo*@dontneed.this
says...
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??


"Text at any angle"
http://www.bobpowell.net/angletext.htm

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 20 '05 #3
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
----------------------
"Ken Hunt" <yo*@dontneed.this> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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

Nov 20 '05 #4

Got to draw your string before you rotate :)

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
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
.

Nov 20 '05 #5
* "Eric Fleet" <an*******@discussions.microsoft.com> scripsit:
Got to draw your string before you rotate :)


Yep, you will need a call to 'TranslateTransform' too.

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

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

Similar topics

1
by: Rocketman | last post by:
Can you have Horizontal and Vertical text in a Textbox or RichTextbox and can u have both together.
1
by: James Dean | last post by:
Can you make vertical text in a richtextbox or is there any way around this like make the string vertical outside the textbox then try to paste it in that way into the textbox?.... *** Sent...
0
by: Stephen Muecke | last post by:
I use the following code to draw vertical text in an ownerdrawn StatusBar The text is drawn top to bottom. Is there a way to have the text drawn bottom to top? Stephen Private Sub...
5
by: Stan McCann | last post by:
Is there a way, or does anyone know if maybe in CSS3, there is a plan to implement vertical rotated text? At http://alamo.nmsu.edu/roundup/schedule.html, in the information I was provided,...
2
by: marss | last post by:
The text for the chart Y-axis title is to be drawn vertically. Here is the snippet of my code. ..... StringFormat drawFormat = new StringFormat(); drawFormat.FormatFlags =...
2
by: harvie wang | last post by:
Hi, I want to show vertical text in textbox, how to do? Best Wish, Harvie 2006-7-16
7
by: pradheepayyanar | last post by:
I need a table header with text aligned vertically. I wrote a css and it works fine with IE, but mozilla doesn't support that. Is there any other way that we can represent vetical text? Code i...
4
by: umlv | last post by:
Hi, I have a question about vertical text property for labels. I have set several labels to show vertical text on one of my forms. I had no problems with them on my desktop computer. Now I...
4
by: marfola | last post by:
I'm trying to implement bottom-to-top vertical text using CSS attributes in IE : writing-mode: tb-rl; filter: flipv fliph; But I have encountered the following: the text is...
7
by: Mr Key | last post by:
Hi! Vertical text when placed in a report is read from top to bottom, is it possible to have vertical text so it's read from bottom to top (rotated 180 degrees from the default)? Example. I am...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.