StringAlignment.Near : StringAlignment : Graphics C# Source Code


Custom Search

C# Source Code » Graphics » StringAlignment »

 

StringAlignment.Near








    
 

using System;
using System.Drawing;
using System.Windows.Forms;
   
class FourCorners: Form
{
     public static void Main()
     {
          Application.Run(new FourCorners());
     }
     public FourCorners()
     {
          Text = "Four Corners Text Alignment";
          BackColor = SystemColors.Window;
          ForeColor = SystemColors.WindowText;
          ResizeRedraw = true;
     }
     protected override void OnPaint(PaintEventArgs pea)
     {
          Graphics     graphics   = pea.Graphics;
          Brush        brush  = new SolidBrush(ForeColor);
          StringFormat strfmt = new StringFormat();
   
          strfmt.Alignment     = StringAlignment.Near;
          strfmt.LineAlignment = StringAlignment.Near;
          graphics.DrawString("Upper left corner", Font, brush, 0, 0, strfmt);
   
     }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Graphics
» StringAlignment