Solved

Drawing Vertical Text

Posted on 2004-09-15
2
291 Views
Last Modified: 2010-04-15
I am currently learning GDI+ and have come across the need to write vertical text onto a form. How would one go about doing that?
0
Comment
Question by:Thora_Fan
2 Comments
 
LVL 10

Accepted Solution

by:
123654789987 earned 250 total points
ID: 12072198
See the following samples

Public void DrawVerticalString()
{
  System.Drawing.Graphics  formGraphics ;
   String  drawString ;
  System.Drawing.Font drawFont;
 System.Drawing.SolidBrush drawBrush;
formGraphics = System.Drawing.Graphics = Me.CreateGraphics();
     drawString = "Sample Text";
     drawFont = New System.Drawing.Font("Arial", 16);
     drawBrush = new      System.Drawing.SolidBrush(System.Drawing.Color.Black);
    Single x  = 150.0;
    Single y  = 50.0;
    System.Drawing.StringFormat()
drawFormat = new System.Drawing.StringFormat();
    drawFormat.FormatFlags = StringFormatFlags.DirectionVertical
        formGraphics.DrawString(drawString, drawFont, drawBrush, _
        x, y, drawFormat);
    drawFont.Dispose();
    drawBrush.Dispose();
    formGraphics.Dispose();
}
End Sub


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vbcode/html/vbtskCodeExampleDrawingTextOnForm.asp

http://www.syncfusion.com/FAQ/WinForms/FAQ_c73c.asp
0
 

Expert Comment

by:walletless
ID: 12077702
Class cl = new System.Drawing.StringFormat();
cl.FormatFlags = StringFormatFlags.DirectionVertical;
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now