<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net%2F2D%2FText_Layout</id>
		<title>VB.Net/2D/Text Layout - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net%2F2D%2FText_Layout"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net/2D/Text_Layout&amp;action=history"/>
		<updated>2026-04-05T13:12:32Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net/2D/Text_Layout&amp;diff=96&amp;oldid=prev</id>
		<title> в 16:40, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net/2D/Text_Layout&amp;diff=96&amp;oldid=prev"/>
				<updated>2010-05-26T16:40:06Z</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;Версия 16:40, 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://www.vbex.ru/index.php?title=VB.Net/2D/Text_Layout&amp;diff=97&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net/2D/Text_Layout&amp;diff=97&amp;oldid=prev"/>
				<updated>2010-05-26T12:41:49Z</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;==MultiLine Text Automatically Layout Demo==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;&lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.ruponentModel&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Data&lt;br /&gt;
Imports System.Configuration&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Drawing.Text&lt;br /&gt;
Imports System.Globalization&lt;br /&gt;
Imports System.Text&lt;br /&gt;
Imports System.Collections&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
        Dim myform As Form = New MultiLineTextForm()&lt;br /&gt;
        Application.Run(myform)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
Public Class MultiLineTextForm&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        &amp;quot;This call is required by the Windows Form Designer.&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
        &amp;quot;Add any initialization after the InitializeComponent() call&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    Friend WithEvents groupBox1 As System.Windows.Forms.GroupBox&lt;br /&gt;
    Friend WithEvents automaticPanel As System.Windows.Forms.Panel&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.groupBox1 = New System.Windows.Forms.GroupBox()&lt;br /&gt;
        Me.automaticPanel = New System.Windows.Forms.Panel()&lt;br /&gt;
        Me.groupBox1.SuspendLayout()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        Me.groupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.automaticPanel})&lt;br /&gt;
        Me.groupBox1.Dock = System.Windows.Forms.DockStyle.Left&lt;br /&gt;
        Me.groupBox1.Font = New System.Drawing.Font(&amp;quot;Microsoft Sans Serif&amp;quot;, 12.0!)&lt;br /&gt;
        Me.groupBox1.Name = &amp;quot;groupBox1&amp;quot;&lt;br /&gt;
        Me.groupBox1.Size = New System.Drawing.Size(152, 266)&lt;br /&gt;
        Me.groupBox1.TabIndex = 3&lt;br /&gt;
        Me.groupBox1.TabStop = False&lt;br /&gt;
        Me.groupBox1.Text = &amp;quot;Automatic&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;automaticPanel&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.automaticPanel.BackColor = System.Drawing.Color.White&lt;br /&gt;
        Me.automaticPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D&lt;br /&gt;
        Me.automaticPanel.Dock = System.Windows.Forms.DockStyle.Fill&lt;br /&gt;
        Me.automaticPanel.Font = New System.Drawing.Font(&amp;quot;Microsoft Sans Serif&amp;quot;, 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))&lt;br /&gt;
        Me.automaticPanel.Location = New System.Drawing.Point(3, 31)&lt;br /&gt;
        Me.automaticPanel.Name = &amp;quot;automaticPanel&amp;quot;&lt;br /&gt;
        Me.automaticPanel.Size = New System.Drawing.Size(146, 232)&lt;br /&gt;
        Me.automaticPanel.TabIndex = 0&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;MultiLineTextForm&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(162, 266)&lt;br /&gt;
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.groupBox1})&lt;br /&gt;
        Me.Name = &amp;quot;MultiLineTextForm&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;MultiLineTextForm&amp;quot;&lt;br /&gt;
        Me.groupBox1.ResumeLayout(False)&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
&lt;br /&gt;
    Dim s As String = &amp;quot;Line 1&amp;quot; &amp;amp; vbCrLf &amp;amp; &amp;quot;Line 2&amp;quot; &amp;amp; vbCrLf &amp;amp; &amp;quot;Line 3&amp;quot; &amp;amp; vbCrLf &amp;amp; &amp;quot;Line 4&amp;quot; &amp;amp; vbCrLf &amp;amp; &amp;quot;Line 5&amp;quot; &amp;amp; vbCrLf &amp;amp; &amp;quot;Line 6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    Private Sub automaticPanel_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles automaticPanel.Paint&lt;br /&gt;
        Dim g As Graphics = e.Graphics&lt;br /&gt;
        Dim layoutRect As RectangleF = RectangleF.op_Implicit(automaticPanel.ClientRectangle)&lt;br /&gt;
        g.DrawString(s, Me.Font, Brushes.Black, layoutRect)&lt;br /&gt;
        Dim size As SizeF = g.MeasureString(s, Me.Font, layoutRect.Size)&lt;br /&gt;
        g.DrawRectangle(Pens.Black, 0, 0, size.Width, size.Height)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub manualPanel_Layout(ByVal sender As Object, ByVal e As System.Windows.Forms.LayoutEventArgs) Handles automaticPanel.Layout&lt;br /&gt;
        Me.automaticPanel.Refresh()&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MultiLine Text Manual Layout==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;&lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.ruponentModel&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Data&lt;br /&gt;
Imports System.Configuration&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Drawing.Text&lt;br /&gt;
Imports System.Globalization&lt;br /&gt;
Imports System.Text&lt;br /&gt;
Imports System.Collections&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
        Dim myform As Form = New MultiLineTextForm()&lt;br /&gt;
        Application.Run(myform)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
Public Class MultiLineTextForm&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        &amp;quot;This call is required by the Windows Form Designer.&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
        &amp;quot;Add any initialization after the InitializeComponent() call&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    Friend WithEvents groupBox2 As System.Windows.Forms.GroupBox&lt;br /&gt;
    Friend WithEvents manualPanel As System.Windows.Forms.Panel&lt;br /&gt;
    Friend WithEvents automaticPanel As System.Windows.Forms.Panel&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.groupBox2 = New System.Windows.Forms.GroupBox()&lt;br /&gt;
        Me.manualPanel = New System.Windows.Forms.Panel()&lt;br /&gt;
        Me.automaticPanel = New System.Windows.Forms.Panel()&lt;br /&gt;
        Me.groupBox2.SuspendLayout()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;groupBox2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.groupBox2.Controls.AddRange(New System.Windows.Forms.Control() {Me.manualPanel})&lt;br /&gt;
        Me.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill&lt;br /&gt;
        Me.groupBox2.Font = New System.Drawing.Font(&amp;quot;Microsoft Sans Serif&amp;quot;, 18.0!)&lt;br /&gt;
        Me.groupBox2.Location = New System.Drawing.Point(155, 0)&lt;br /&gt;
        Me.groupBox2.Name = &amp;quot;groupBox2&amp;quot;&lt;br /&gt;
        Me.groupBox2.Size = New System.Drawing.Size(137, 266)&lt;br /&gt;
        Me.groupBox2.TabIndex = 5&lt;br /&gt;
        Me.groupBox2.TabStop = False&lt;br /&gt;
        Me.groupBox2.Text = &amp;quot;Manual&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;manualPanel&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.manualPanel.BackColor = System.Drawing.Color.White&lt;br /&gt;
        Me.manualPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D&lt;br /&gt;
        Me.manualPanel.Dock = System.Windows.Forms.DockStyle.Fill&lt;br /&gt;
        Me.manualPanel.Font = New System.Drawing.Font(&amp;quot;Microsoft Sans Serif&amp;quot;, 18.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))&lt;br /&gt;
        Me.manualPanel.Location = New System.Drawing.Point(3, 31)&lt;br /&gt;
        Me.manualPanel.Name = &amp;quot;manualPanel&amp;quot;&lt;br /&gt;
        Me.manualPanel.Size = New System.Drawing.Size(131, 232)&lt;br /&gt;
        Me.manualPanel.TabIndex = 0&lt;br /&gt;
       &lt;br /&gt;
        &amp;quot;MultiLineTextForm&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(292, 266)&lt;br /&gt;
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.groupBox2})&lt;br /&gt;
        Me.Name = &amp;quot;MultiLineTextForm&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;MultiLineTextForm&amp;quot;&lt;br /&gt;
        Me.groupBox2.ResumeLayout(False)&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
&lt;br /&gt;
    Dim s As String = &amp;quot;Line 1&amp;quot; &amp;amp; vbCrLf &amp;amp; &amp;quot;Line 2&amp;quot; &amp;amp; vbCrLf &amp;amp; &amp;quot;Line 3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    Private Sub manualPanel_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles manualPanel.Paint&lt;br /&gt;
        Dim g As Graphics = e.Graphics&lt;br /&gt;
        Dim y As Single = 0&lt;br /&gt;
        Dim arrPens As Pen() = New Pen() {Pens.Red, Pens.Green, Pens.Blue}&lt;br /&gt;
        Dim line As String&lt;br /&gt;
        For Each line In s.Split(vbCrLf)&lt;br /&gt;
            Dim width As Single = manualPanel.ClientRectangle.Width&lt;br /&gt;
            Dim height As Single = manualPanel.ClientRectangle.Height - y&lt;br /&gt;
            Dim layoutRect As RectangleF = New RectangleF(0, y, width, height)&lt;br /&gt;
            Dim format As StringFormat = New StringFormat(StringFormatFlags.NoWrap Or StringFormatFlags.DisplayFormatControl)&lt;br /&gt;
            g.DrawString(line, Me.Font, Brushes.Black, layoutRect, format)&lt;br /&gt;
            Dim size As SizeF = g.MeasureString(line, Me.Font, layoutRect.Size, format)&lt;br /&gt;
            g.DrawRectangle(arrPens(CInt(y / Me.Font.GetHeight(g))), 0, y, size.Width, size.Height)&lt;br /&gt;
            y = y + Me.Font.GetHeight(g)&lt;br /&gt;
        Next&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub manualPanel_Layout(ByVal sender As Object, ByVal e As System.Windows.Forms.LayoutEventArgs) Handles manualPanel.Layout&lt;br /&gt;
  &lt;br /&gt;
        Me.manualPanel.Refresh()&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>