473,320 Members | 2,147 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,320 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 11908
* "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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.