Solved

Drawing Vertical Text

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

860 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