<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2F2D_Graphics%2FText_Justify</id>
		<title>Csharp/C Sharp/2D Graphics/Text Justify - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2F2D_Graphics%2FText_Justify"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/2D_Graphics/Text_Justify&amp;action=history"/>
		<updated>2026-04-29T20:10:10Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/2D_Graphics/Text_Justify&amp;diff=883&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/2D_Graphics/Text_Justify&amp;diff=883&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:19Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/2D_Graphics/Text_Justify&amp;diff=884&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/2D_Graphics/Text_Justify&amp;diff=884&amp;oldid=prev"/>
				<updated>2010-05-26T11:42:10Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==a long string that will wrap and centered both vertically and horizontally==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
    &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class Form1 : Form {&lt;br /&gt;
    protected override void OnPaint(PaintEventArgs e) {&lt;br /&gt;
    Graphics g = e.Graphics;&lt;br /&gt;
    g.FillRectangle(Brushes.White, this.ClientRectangle);&lt;br /&gt;
    String s = &amp;quot;This is a long string that will wrap. &amp;quot;;&lt;br /&gt;
    s += &amp;quot;It will be centered both vertically and horizontally.&amp;quot;;&lt;br /&gt;
    Font f = new Font(&amp;quot;Arial&amp;quot;, 12);&lt;br /&gt;
    StringFormat sf = new StringFormat();&lt;br /&gt;
    sf.Alignment = StringAlignment.Center;        &lt;br /&gt;
    sf.LineAlignment = StringAlignment.Center;    &lt;br /&gt;
    Rectangle r = new Rectangle(10, 10, 300, f.Height * 4);&lt;br /&gt;
    g.DrawRectangle(Pens.Black, r);&lt;br /&gt;
    g.DrawString(s, f, Brushes.Black, r, sf);&lt;br /&gt;
    f.Dispose();&lt;br /&gt;
    }&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        Application.Run(new Form1());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Draw left justified text==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Data;&lt;br /&gt;
public class Form1 : System.Windows.Forms.Form{&lt;br /&gt;
  public Form1()&lt;br /&gt;
  {&lt;br /&gt;
        InitializeComponent();&lt;br /&gt;
        SetStyle(ControlStyles.Opaque, true);&lt;br /&gt;
        Bounds = new Rectangle(0, 0, 500, 300);&lt;br /&gt;
  }&lt;br /&gt;
    protected override void OnPaint(PaintEventArgs e) {&lt;br /&gt;
         Graphics g = e.Graphics;&lt;br /&gt;
   &lt;br /&gt;
         g.FillRectangle(Brushes.White, ClientRectangle);&lt;br /&gt;
         // Draw left justified text&lt;br /&gt;
         Rectangle rect = new Rectangle(0, 0, 400, Font.Height);&lt;br /&gt;
         g.DrawRectangle(Pens.Blue, rect);&lt;br /&gt;
         g.DrawString(&amp;quot;www.nfex.ru&amp;quot;, Font,&lt;br /&gt;
            Brushes.Black, rect);&lt;br /&gt;
      }&lt;br /&gt;
    private void InitializeComponent()&lt;br /&gt;
    {&lt;br /&gt;
      this.Size = new System.Drawing.Size(300,300);&lt;br /&gt;
      this.Text = &amp;quot;Form1&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    static void Main() &lt;br /&gt;
    {&lt;br /&gt;
      Application.Run(new Form1());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Draw Rectangle surrounding the Text==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Drawing.Drawing2D;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class Form1 : Form {&lt;br /&gt;
    protected override void OnPaint(PaintEventArgs e) {&lt;br /&gt;
    Graphics g = e.Graphics;&lt;br /&gt;
    g.PageUnit = GraphicsUnit.Inch;&lt;br /&gt;
    Pen p = new Pen(Color.Black, 1 / 96f);&lt;br /&gt;
    Font f = new Font(&amp;quot;Times New Roman&amp;quot;, 16);&lt;br /&gt;
    String s = &amp;quot;Abc&amp;quot;;&lt;br /&gt;
    SizeF sf = g.MeasureString(s, f);&lt;br /&gt;
    g.DrawRectangle(p, 1, 1, sf.Width, sf.Height);&lt;br /&gt;
    g.DrawString(s, f, Brushes.Black, 1, 1);&lt;br /&gt;
    f.Dispose();&lt;br /&gt;
    p.Dispose();&lt;br /&gt;
    }&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        Application.Run(new Form1());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Draw right justified text==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Data;&lt;br /&gt;
public class Form1 : System.Windows.Forms.Form{&lt;br /&gt;
  public Form1()&lt;br /&gt;
  {&lt;br /&gt;
        InitializeComponent();&lt;br /&gt;
        SetStyle(ControlStyles.Opaque, true);&lt;br /&gt;
        Bounds = new Rectangle(0, 0, 500, 300);&lt;br /&gt;
  }&lt;br /&gt;
    protected override void OnPaint(PaintEventArgs e) {&lt;br /&gt;
         Graphics g = e.Graphics;&lt;br /&gt;
   &lt;br /&gt;
         g.FillRectangle(Brushes.White, ClientRectangle);&lt;br /&gt;
&lt;br /&gt;
         // Draw right justified text&lt;br /&gt;
         Font aFont = new Font(&amp;quot;Arial&amp;quot;, 16, FontStyle.Bold | FontStyle.Italic);&lt;br /&gt;
         Rectangle rect = new Rectangle(0, 0, 400, aFont.Height);&lt;br /&gt;
         g.DrawRectangle(Pens.Blue, rect);&lt;br /&gt;
         &lt;br /&gt;
         StringFormat sf = new StringFormat();&lt;br /&gt;
         sf.Alignment = StringAlignment.Far;&lt;br /&gt;
         g.DrawString(&amp;quot;www.nfex.ru&amp;quot;, aFont, Brushes.Blue,&lt;br /&gt;
            rect, sf);&lt;br /&gt;
      }&lt;br /&gt;
    private void InitializeComponent()&lt;br /&gt;
    {&lt;br /&gt;
      this.Size = new System.Drawing.Size(300,300);&lt;br /&gt;
      this.Text = &amp;quot;Form1&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    static void Main() &lt;br /&gt;
    {&lt;br /&gt;
      Application.Run(new Form1());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Draw the rectangle and draw the string, using the rectangle as a bounding box==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class Form1 : Form {&lt;br /&gt;
    protected override void OnPaint(PaintEventArgs e) {&lt;br /&gt;
    Graphics g = e.Graphics;&lt;br /&gt;
    g.FillRectangle(Brushes.White, this.ClientRectangle);&lt;br /&gt;
    String s = &amp;quot;This string is long enough to wrap. &amp;quot;;&lt;br /&gt;
    Font f = new Font(&amp;quot;Arial&amp;quot;, 12);&lt;br /&gt;
    Rectangle r = new Rectangle(20, 20, 150, f.Height * 4);&lt;br /&gt;
    StringFormat sf = new StringFormat();&lt;br /&gt;
    sf.FormatFlags = StringFormatFlags.NoWrap;&lt;br /&gt;
    g.DrawRectangle(Pens.Black, r);&lt;br /&gt;
    g.DrawString(s, f, Brushes.Black, r, sf);&lt;br /&gt;
    f.Dispose();&lt;br /&gt;
    }&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        Application.Run(new Form1());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Rotate the text 45 degrees clockwise and translate the text 150 pixels horizontally==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Drawing.Drawing2D;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class Form1 : Form {&lt;br /&gt;
    protected override void OnPaint(PaintEventArgs e) {&lt;br /&gt;
    Graphics g = e.Graphics;&lt;br /&gt;
    g.FillRectangle(Brushes.White, this.ClientRectangle);&lt;br /&gt;
    Font f = new Font(&amp;quot;Times New Roman&amp;quot;, 24);&lt;br /&gt;
    g.DrawString(&amp;quot;Rotate then Translate&amp;quot;, f, Brushes.Black, 0, 0);&lt;br /&gt;
    g.RotateTransform(45);&lt;br /&gt;
    g.TranslateTransform(150, 0);&lt;br /&gt;
    g.DrawString(&amp;quot;Rotate  then Translate &amp;quot;, f, Brushes.Black, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        Application.Run(new Form1());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==String Rectangle==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class Form1 : Form {&lt;br /&gt;
    protected override void OnPaint(PaintEventArgs e) {&lt;br /&gt;
    Graphics g = e.Graphics;&lt;br /&gt;
    g.FillRectangle(Brushes.White, this.ClientRectangle);&lt;br /&gt;
    String s = &amp;quot;AAAAAAAAAA&amp;quot;;&lt;br /&gt;
    StringFormat sf = new StringFormat(StringFormatFlags.DirectionVertical);&lt;br /&gt;
    Font f = new Font(&amp;quot;Times New Roman&amp;quot;, 14);&lt;br /&gt;
    SizeF sizef = g.MeasureString(s, f, Int32.MaxValue, sf);&lt;br /&gt;
    RectangleF rf = new RectangleF(20, 20, sizef.Width, sizef.Height);&lt;br /&gt;
    g.DrawRectangle(Pens.Black, rf.Left, rf.Top, rf.Width, rf.Height);&lt;br /&gt;
    g.DrawString(s, f, Brushes.Black, rf, sf);&lt;br /&gt;
    f.Dispose();&lt;br /&gt;
    }&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        Application.Run(new Form1());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==This text is centered and underlined==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Data;&lt;br /&gt;
public class Form1 : System.Windows.Forms.Form{&lt;br /&gt;
  public Form1()&lt;br /&gt;
  {&lt;br /&gt;
        InitializeComponent();&lt;br /&gt;
        SetStyle(ControlStyles.Opaque, true);&lt;br /&gt;
        Bounds = new Rectangle(0, 0, 500, 300);&lt;br /&gt;
  }&lt;br /&gt;
    protected override void OnPaint(PaintEventArgs e) {&lt;br /&gt;
         Graphics g = e.Graphics;&lt;br /&gt;
   &lt;br /&gt;
         g.FillRectangle(Brushes.White, ClientRectangle);&lt;br /&gt;
         // draw centered text&lt;br /&gt;
         Font cFont = new Font(&amp;quot;Courier New&amp;quot;, 12, FontStyle.Underline);&lt;br /&gt;
         Rectangle rect = new Rectangle(0, 0, 400, cFont.Height);&lt;br /&gt;
         g.DrawRectangle(Pens.Blue, rect);&lt;br /&gt;
         StringFormat sf = new StringFormat();&lt;br /&gt;
         sf.Alignment = StringAlignment.Center;&lt;br /&gt;
         g.DrawString(&amp;quot;This text is centered  and underlined.&amp;quot;, cFont,&lt;br /&gt;
            Brushes.Red, rect, sf);&lt;br /&gt;
&lt;br /&gt;
      }&lt;br /&gt;
    private void InitializeComponent()&lt;br /&gt;
    {&lt;br /&gt;
      this.Size = new System.Drawing.Size(300,300);&lt;br /&gt;
      this.Text = &amp;quot;Form1&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    static void Main() &lt;br /&gt;
    {&lt;br /&gt;
      Application.Run(new Form1());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==use a 12pt font, and assume the text string must fit into a width of 150 pixels==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class Form1 : Form {&lt;br /&gt;
    protected override void OnPaint(PaintEventArgs e) {&lt;br /&gt;
    Graphics g = e.Graphics;&lt;br /&gt;
    g.FillRectangle(Brushes.White, this.ClientRectangle);&lt;br /&gt;
    String s = &amp;quot;This string is long enough to wrap. &amp;quot;;&lt;br /&gt;
    Font f = new Font(&amp;quot;Arial&amp;quot;, 12);&lt;br /&gt;
    SizeF sf = g.MeasureString(s, f, 150);&lt;br /&gt;
    RectangleF rf = new RectangleF(20, 20, sf.Width, sf.Height);&lt;br /&gt;
    g.DrawRectangle(Pens.Black, rf.Left, rf.Top, rf.Width, rf.Height);&lt;br /&gt;
    g.DrawString(s, f, Brushes.Black, rf); &lt;br /&gt;
    f.Dispose();&lt;br /&gt;
    }&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        Application.Run(new Form1());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Use tab to control the DrawString==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class Form1 : Form {&lt;br /&gt;
    protected override void OnPaint(PaintEventArgs e) {&lt;br /&gt;
    Graphics g = e.Graphics;&lt;br /&gt;
    g.FillRectangle(Brushes.White, this.ClientRectangle);&lt;br /&gt;
    Font f = new Font(&amp;quot;Times New Roman&amp;quot;, 12);&lt;br /&gt;
    Font bf = new Font(f, FontStyle.Bold);&lt;br /&gt;
    StringFormat sf = new StringFormat();&lt;br /&gt;
    float[] ts = { 10.0f, 70.0f, 100.0f, 90.0f };&lt;br /&gt;
    sf.SetTabStops(0.0f, ts);&lt;br /&gt;
    string s1 = &amp;quot;\tA\tAAA\tAAAAA\tAAAAAAAAAA&amp;quot;;&lt;br /&gt;
    string s2 = &amp;quot;\tAAAAAAA\tAAAAA\tAA\tAAA&amp;quot;;&lt;br /&gt;
    g.DrawString(s1, bf, Brushes.Black, 20, 20, sf);&lt;br /&gt;
    g.DrawString(s2, f, Brushes.Blue, 20, 20 + bf.Height, sf);&lt;br /&gt;
    f.Dispose();&lt;br /&gt;
    bf.Dispose();&lt;br /&gt;
    }&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        Application.Run(new Form1());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==With a 200px-width rectangle, and a 12pt font, it requires six lines to display the string in its entirety==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class Form1 : Form {&lt;br /&gt;
    protected override void OnPaint(PaintEventArgs e) {&lt;br /&gt;
    Graphics g = e.Graphics;&lt;br /&gt;
    g.FillRectangle(Brushes.White, this.ClientRectangle);&lt;br /&gt;
    String s = &amp;quot;This string is long enough to wrap. &amp;quot;;&lt;br /&gt;
    Font f = new Font(&amp;quot;Arial&amp;quot;, 12);&lt;br /&gt;
    Rectangle r = new Rectangle(20, 20, 200, f.Height * 6);&lt;br /&gt;
    g.DrawRectangle(Pens.Black, r);&lt;br /&gt;
    g.DrawString(s, f, Brushes.Black, r);&lt;br /&gt;
    f.Dispose();&lt;br /&gt;
    }&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        Application.Run(new Form1());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>