Solved

Drawing Vertical Text

Posted on 2004-09-15
2
294 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

831 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