<?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%2FGUI%2FPrint_Document</id>
		<title>VB.Net/GUI/Print Document - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net%2FGUI%2FPrint_Document"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net/GUI/Print_Document&amp;action=history"/>
		<updated>2026-04-05T19:38:46Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net/GUI/Print_Document&amp;diff=574&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/GUI/Print_Document&amp;diff=574&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/GUI/Print_Document&amp;diff=575&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net/GUI/Print_Document&amp;diff=575&amp;oldid=prev"/>
				<updated>2010-05-26T12:44:33Z</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;==Assign Bmp file to a Print Document==&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.Collections&lt;br /&gt;
Imports System.Data&lt;br /&gt;
Imports System.IO&lt;br /&gt;
Imports System.Xml.Serialization&lt;br /&gt;
Imports System.Windows.Forms&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.Drawing.Printing&lt;br /&gt;
&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
       Dim form1 As Form = New Form1()&lt;br /&gt;
       Application.Run(form1) &lt;br /&gt;
     End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Public Class Form1&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;
    Friend WithEvents PrintDocument1 As System.Drawing.Printing.PrintDocument&lt;br /&gt;
    Friend WithEvents Button1 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.Container&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;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))&lt;br /&gt;
        Me.PrintDocument1 = New System.Drawing.Printing.PrintDocument()&lt;br /&gt;
        Me.Button1 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.PictureBox1 = New System.Windows.Forms.PictureBox()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;PrintDocument1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Button1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Button1.Location = New System.Drawing.Point(16, 216)&lt;br /&gt;
        Me.Button1.Name = &amp;quot;Button1&amp;quot;&lt;br /&gt;
        Me.Button1.Size = New System.Drawing.Size(264, 32)&lt;br /&gt;
        Me.Button1.TabIndex = 0&lt;br /&gt;
        Me.Button1.Text = &amp;quot;Print&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;PictureBox1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.PictureBox1.Image = New System.Drawing.Bitmap(&amp;quot;figure2.bmp&amp;quot;)&lt;br /&gt;
        Me.PictureBox1.Location = New System.Drawing.Point(16, 8)&lt;br /&gt;
        Me.PictureBox1.Name = &amp;quot;PictureBox1&amp;quot;&lt;br /&gt;
        Me.PictureBox1.Size = New System.Drawing.Size(264, 200)&lt;br /&gt;
        Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage&lt;br /&gt;
        Me.PictureBox1.TabIndex = 1&lt;br /&gt;
        Me.PictureBox1.TabStop = False&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 15)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(292, 268)&lt;br /&gt;
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.PictureBox1, Me.Button1})&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;Printing demo&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, _&lt;br /&gt;
         ByVal e As System.Drawing.Printing.PrintPageEventArgs) _&lt;br /&gt;
         Handles PrintDocument1.PrintPage&lt;br /&gt;
        Dim g As Graphics&lt;br /&gt;
        g = e.Graphics&lt;br /&gt;
        g.DrawImage(PictureBox1.Image, 0, 0)&lt;br /&gt;
        g.Dispose()&lt;br /&gt;
        e.HasMorePages = False&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;br /&gt;
        PrintDocument1.Print()&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&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;
==Print Test==&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.Drawing.Printing&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
&amp;lt;Global.Microsoft.VisualBasic.rupilerServices.DesignerGenerated()&amp;gt; _&lt;br /&gt;
Partial Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; _&lt;br /&gt;
    Private Sub InitializeComponent()&lt;br /&gt;
        Me.cmdPreviewInForm = New System.Windows.Forms.Button&lt;br /&gt;
        Me.Preview = New System.Windows.Forms.PrintPreviewControl&lt;br /&gt;
        Me.cmdPreview = New System.Windows.Forms.Button&lt;br /&gt;
        Me.lblStatus = New System.Windows.Forms.Label&lt;br /&gt;
        Me.cmdPrint = New System.Windows.Forms.Button&lt;br /&gt;
        Me.GroupBox1 = New System.Windows.Forms.GroupBox&lt;br /&gt;
        Me.RadioButton1 = New System.Windows.Forms.RadioButton&lt;br /&gt;
        Me.RadioButton2 = New System.Windows.Forms.RadioButton&lt;br /&gt;
        Me.RadioButton3 = New System.Windows.Forms.RadioButton&lt;br /&gt;
        Me.RadioButton4 = New System.Windows.Forms.RadioButton&lt;br /&gt;
        Me.RadioButton5 = New System.Windows.Forms.RadioButton&lt;br /&gt;
        Me.GroupBox1.SuspendLayout()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;cmdPreviewInForm&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.cmdPreviewInForm.Location = New System.Drawing.Point(12, 76)&lt;br /&gt;
        Me.cmdPreviewInForm.Name = &amp;quot;cmdPreviewInForm&amp;quot;&lt;br /&gt;
        Me.cmdPreviewInForm.Size = New System.Drawing.Size(148, 24)&lt;br /&gt;
        Me.cmdPreviewInForm.TabIndex = 9&lt;br /&gt;
        Me.cmdPreviewInForm.Text = &amp;quot;Preview (In Form)&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Preview&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Preview.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _&lt;br /&gt;
                    Or System.Windows.Forms.AnchorStyles.Left) _&lt;br /&gt;
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)&lt;br /&gt;
        Me.Preview.AutoZoom = False&lt;br /&gt;
        Me.Preview.Location = New System.Drawing.Point(180, 12)&lt;br /&gt;
        Me.Preview.Name = &amp;quot;Preview&amp;quot;&lt;br /&gt;
        Me.Preview.Size = New System.Drawing.Size(339, 350)&lt;br /&gt;
        Me.Preview.TabIndex = 8&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;cmdPreview&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.cmdPreview.Location = New System.Drawing.Point(12, 44)&lt;br /&gt;
        Me.cmdPreview.Name = &amp;quot;cmdPreview&amp;quot;&lt;br /&gt;
        Me.cmdPreview.Size = New System.Drawing.Size(148, 24)&lt;br /&gt;
        Me.cmdPreview.TabIndex = 7&lt;br /&gt;
        Me.cmdPreview.Text = &amp;quot;Preview (Stand-alone)&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;lblStatus&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.lblStatus.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _&lt;br /&gt;
                    Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)&lt;br /&gt;
        Me.lblStatus.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D&lt;br /&gt;
        Me.lblStatus.Location = New System.Drawing.Point(12, 235)&lt;br /&gt;
        Me.lblStatus.Name = &amp;quot;lblStatus&amp;quot;&lt;br /&gt;
        Me.lblStatus.Size = New System.Drawing.Size(148, 127)&lt;br /&gt;
        Me.lblStatus.TabIndex = 6&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;cmdPrint&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.cmdPrint.Location = New System.Drawing.Point(12, 12)&lt;br /&gt;
        Me.cmdPrint.Name = &amp;quot;cmdPrint&amp;quot;&lt;br /&gt;
        Me.cmdPrint.Size = New System.Drawing.Size(148, 24)&lt;br /&gt;
        Me.cmdPrint.TabIndex = 5&lt;br /&gt;
        Me.cmdPrint.Text = &amp;quot;Print&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;GroupBox1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.GroupBox1.Controls.Add(Me.RadioButton5)&lt;br /&gt;
        Me.GroupBox1.Controls.Add(Me.RadioButton4)&lt;br /&gt;
        Me.GroupBox1.Controls.Add(Me.RadioButton3)&lt;br /&gt;
        Me.GroupBox1.Controls.Add(Me.RadioButton2)&lt;br /&gt;
        Me.GroupBox1.Controls.Add(Me.RadioButton1)&lt;br /&gt;
        Me.GroupBox1.Location = New System.Drawing.Point(12, 108)&lt;br /&gt;
        Me.GroupBox1.Name = &amp;quot;GroupBox1&amp;quot;&lt;br /&gt;
        Me.GroupBox1.Size = New System.Drawing.Size(148, 111)&lt;br /&gt;
        Me.GroupBox1.TabIndex = 10&lt;br /&gt;
        Me.GroupBox1.TabStop = False&lt;br /&gt;
        Me.GroupBox1.Text = &amp;quot;Zoom&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;RadioButton1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.RadioButton1.AutoSize = True&lt;br /&gt;
        Me.RadioButton1.Location = New System.Drawing.Point(16, 17)&lt;br /&gt;
        Me.RadioButton1.Name = &amp;quot;RadioButton1&amp;quot;&lt;br /&gt;
        Me.RadioButton1.Size = New System.Drawing.Size(48, 17)&lt;br /&gt;
        Me.RadioButton1.TabIndex = 11&lt;br /&gt;
        Me.RadioButton1.TabStop = True&lt;br /&gt;
        Me.RadioButton1.Text = &amp;quot;25%&amp;quot;&lt;br /&gt;
        Me.RadioButton1.UseVisualStyleBackColor = True&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;RadioButton2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.RadioButton2.AutoSize = True&lt;br /&gt;
        Me.RadioButton2.Location = New System.Drawing.Point(16, 34)&lt;br /&gt;
        Me.RadioButton2.Name = &amp;quot;RadioButton2&amp;quot;&lt;br /&gt;
        Me.RadioButton2.Size = New System.Drawing.Size(48, 17)&lt;br /&gt;
        Me.RadioButton2.TabIndex = 12&lt;br /&gt;
        Me.RadioButton2.TabStop = True&lt;br /&gt;
        Me.RadioButton2.Text = &amp;quot;50%&amp;quot;&lt;br /&gt;
        Me.RadioButton2.UseVisualStyleBackColor = True&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;RadioButton3&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.RadioButton3.AutoSize = True&lt;br /&gt;
        Me.RadioButton3.Location = New System.Drawing.Point(16, 68)&lt;br /&gt;
        Me.RadioButton3.Name = &amp;quot;RadioButton3&amp;quot;&lt;br /&gt;
        Me.RadioButton3.Size = New System.Drawing.Size(54, 17)&lt;br /&gt;
        Me.RadioButton3.TabIndex = 13&lt;br /&gt;
        Me.RadioButton3.TabStop = True&lt;br /&gt;
        Me.RadioButton3.Text = &amp;quot;100%&amp;quot;&lt;br /&gt;
        Me.RadioButton3.UseVisualStyleBackColor = True&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;RadioButton4&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.RadioButton4.AutoSize = True&lt;br /&gt;
        Me.RadioButton4.Location = New System.Drawing.Point(16, 85)&lt;br /&gt;
        Me.RadioButton4.Name = &amp;quot;RadioButton4&amp;quot;&lt;br /&gt;
        Me.RadioButton4.Size = New System.Drawing.Size(54, 17)&lt;br /&gt;
        Me.RadioButton4.TabIndex = 14&lt;br /&gt;
        Me.RadioButton4.TabStop = True&lt;br /&gt;
        Me.RadioButton4.Text = &amp;quot;200%&amp;quot;&lt;br /&gt;
        Me.RadioButton4.UseVisualStyleBackColor = True&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;RadioButton5&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.RadioButton5.AutoSize = True&lt;br /&gt;
        Me.RadioButton5.Location = New System.Drawing.Point(16, 51)&lt;br /&gt;
        Me.RadioButton5.Name = &amp;quot;RadioButton5&amp;quot;&lt;br /&gt;
        Me.RadioButton5.Size = New System.Drawing.Size(48, 17)&lt;br /&gt;
        Me.RadioButton5.TabIndex = 15&lt;br /&gt;
        Me.RadioButton5.TabStop = True&lt;br /&gt;
        Me.RadioButton5.Text = &amp;quot;75%&amp;quot;&lt;br /&gt;
        Me.RadioButton5.UseVisualStyleBackColor = True&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)&lt;br /&gt;
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(531, 374)&lt;br /&gt;
        Me.Controls.Add(Me.GroupBox1)&lt;br /&gt;
        Me.Controls.Add(Me.cmdPreviewInForm)&lt;br /&gt;
        Me.Controls.Add(Me.Preview)&lt;br /&gt;
        Me.Controls.Add(Me.cmdPreview)&lt;br /&gt;
        Me.Controls.Add(Me.lblStatus)&lt;br /&gt;
        Me.Controls.Add(Me.cmdPrint)&lt;br /&gt;
        Me.Font = New System.Drawing.Font(&amp;quot;Tahoma&amp;quot;, 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))&lt;br /&gt;
        Me.Text = &amp;quot;Print Test&amp;quot;&lt;br /&gt;
        Me.GroupBox1.ResumeLayout(False)&lt;br /&gt;
        Me.GroupBox1.PerformLayout()&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Friend WithEvents cmdPreviewInForm As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents Preview As System.Windows.Forms.PrintPreviewControl&lt;br /&gt;
    Friend WithEvents cmdPreview As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents lblStatus As System.Windows.Forms.Label&lt;br /&gt;
    Friend WithEvents cmdPrint As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox&lt;br /&gt;
    Friend WithEvents RadioButton4 As System.Windows.Forms.RadioButton&lt;br /&gt;
    Friend WithEvents RadioButton3 As System.Windows.Forms.RadioButton&lt;br /&gt;
    Friend WithEvents RadioButton2 As System.Windows.Forms.RadioButton&lt;br /&gt;
    Friend WithEvents RadioButton1 As System.Windows.Forms.RadioButton&lt;br /&gt;
    Friend WithEvents RadioButton5 As System.Windows.Forms.RadioButton&lt;br /&gt;
    Private WithEvents MyDoc As New PrintDocument()&lt;br /&gt;
    Private PageNumber As Integer&lt;br /&gt;
    Private Offset As Integer&lt;br /&gt;
    Private PrintData(100) As String&lt;br /&gt;
    Private Sub PrintStatus_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
        Dim i As Integer&lt;br /&gt;
        For i = 0 To 100&lt;br /&gt;
            PrintData(i) = &amp;quot;This is line number &amp;quot; &amp;amp; i + 1 &amp;amp; &amp;quot;. &amp;quot;&lt;br /&gt;
        Next&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub cmdPrint_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles cmdPrint.Click&lt;br /&gt;
        lblStatus.Text = &amp;quot;&amp;quot;&lt;br /&gt;
        PageNumber = 0&lt;br /&gt;
        Offset = 0&lt;br /&gt;
        Dim dlgSettings As New PrintDialog()&lt;br /&gt;
        dlgSettings.Document = MyDoc&lt;br /&gt;
        Dim Result As DialogResult&lt;br /&gt;
        Result = dlgSettings.ShowDialog()&lt;br /&gt;
        If Result = DialogResult.OK Then MyDoc.Print()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub MyDoc_PrintPage(ByVal sender As Object, ByVal e As PrintPageEventArgs) Handles MyDoc.PrintPage&lt;br /&gt;
        Dim MyFont As New Font(&amp;quot;Arial&amp;quot;, 10)&lt;br /&gt;
        Dim LineHeight As Single = MyFont.GetHeight(e.Graphics)&lt;br /&gt;
        Dim x As Single = e.MarginBounds.Left&lt;br /&gt;
        Dim y As Single = e.MarginBounds.Top&lt;br /&gt;
        PageNumber += 1&lt;br /&gt;
        lblStatus.Text &amp;amp;= vbNewLine &amp;amp; &amp;quot;Sending Page &amp;quot; &amp;amp; PageNumber &amp;amp; &amp;quot; ...&amp;quot;&lt;br /&gt;
        Do&lt;br /&gt;
            e.Graphics.DrawString(PrintData(Offset), MyFont, Brushes.Black, x, y)&lt;br /&gt;
            Offset += 1&lt;br /&gt;
            y += LineHeight&lt;br /&gt;
        Loop Until (y + LineHeight) &amp;gt; e.MarginBounds.Bottom Or Offset &amp;gt; PrintData.GetUpperBound(0)&lt;br /&gt;
        If Offset &amp;lt; PrintData.GetUpperBound(0) Then&lt;br /&gt;
            e.HasMorePages = True&lt;br /&gt;
        Else&lt;br /&gt;
            Offset = 0&lt;br /&gt;
            lblStatus.Text &amp;amp;= vbNewLine &amp;amp; &amp;quot;Print or Preview Completed&amp;quot;&lt;br /&gt;
        End If&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub cmdPreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdPreview.Click&lt;br /&gt;
        lblStatus.Text = &amp;quot;&amp;quot;&lt;br /&gt;
        Dim dlgPreview As New PrintPreviewDialog()&lt;br /&gt;
        dlgPreview.Document = MyDoc&lt;br /&gt;
        dlgPreview.Show()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub cmdPreviewInForm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdPreviewInForm.Click&lt;br /&gt;
        lblStatus.Text = &amp;quot;&amp;quot;&lt;br /&gt;
        Preview.Zoom = 0.2&lt;br /&gt;
        Preview.Columns = 2&lt;br /&gt;
        Preview.Rows = 3&lt;br /&gt;
        Preview.Document = MyDoc&lt;br /&gt;
        Preview.InvalidatePreview()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged, RadioButton4.Click, RadioButton3.Click, RadioButton2.Click, RadioButton1.Click, RadioButton5.CheckedChanged&lt;br /&gt;
        Dim ctrl As Control = CType(sender, Control)&lt;br /&gt;
        Preview.Zoom = Val(ctrl.Text) / 100&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Wrapped Printing==&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.Drawing.Printing&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
&amp;lt;Global.Microsoft.VisualBasic.rupilerServices.DesignerGenerated()&amp;gt; _&lt;br /&gt;
Partial Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; _&lt;br /&gt;
    Private Sub InitializeComponent()&lt;br /&gt;
        Dim resources As System.ruponentModel.ruponentResourceManager = New System.ruponentModel.ruponentResourceManager(GetType(Form1))&lt;br /&gt;
        Me.cmdPrintWrapped = New System.Windows.Forms.Button&lt;br /&gt;
        Me.Label1 = New System.Windows.Forms.Label&lt;br /&gt;
        Me.cmdPrint = New System.Windows.Forms.Button&lt;br /&gt;
        Me.txtData = New System.Windows.Forms.TextBox&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.cmdPrintWrapped.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)&lt;br /&gt;
        Me.cmdPrintWrapped.Location = New System.Drawing.Point(210, 174)&lt;br /&gt;
        Me.cmdPrintWrapped.Name = &amp;quot;cmdPrintWrapped&amp;quot;&lt;br /&gt;
        Me.cmdPrintWrapped.Size = New System.Drawing.Size(104, 24)&lt;br /&gt;
        Me.cmdPrintWrapped.TabIndex = 7&lt;br /&gt;
        Me.cmdPrintWrapped.Text = &amp;quot;Print Wrapped&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Label1.Location = New System.Drawing.Point(14, 10)&lt;br /&gt;
        Me.Label1.Name = &amp;quot;Label1&amp;quot;&lt;br /&gt;
        Me.Label1.Size = New System.Drawing.Size(164, 16)&lt;br /&gt;
        Me.Label1.TabIndex = 6&lt;br /&gt;
        Me.Label1.Text = &amp;quot;Text To Print:&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;cmdPrint&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.cmdPrint.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)&lt;br /&gt;
        Me.cmdPrint.Location = New System.Drawing.Point(14, 174)&lt;br /&gt;
        Me.cmdPrint.Name = &amp;quot;cmdPrint&amp;quot;&lt;br /&gt;
        Me.cmdPrint.Size = New System.Drawing.Size(104, 24)&lt;br /&gt;
        Me.cmdPrint.TabIndex = 5&lt;br /&gt;
        Me.cmdPrint.Text = &amp;quot;Print Unwrapped&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;txtData&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.txtData.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _&lt;br /&gt;
                    Or System.Windows.Forms.AnchorStyles.Left) _&lt;br /&gt;
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)&lt;br /&gt;
        Me.txtData.Font = New System.Drawing.Font(&amp;quot;Tahoma&amp;quot;, 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))&lt;br /&gt;
        Me.txtData.Location = New System.Drawing.Point(14, 30)&lt;br /&gt;
        Me.txtData.Multiline = True&lt;br /&gt;
        Me.txtData.Name = &amp;quot;txtData&amp;quot;&lt;br /&gt;
        Me.txtData.ReadOnly = True&lt;br /&gt;
        Me.txtData.ScrollBars = System.Windows.Forms.ScrollBars.Vertical&lt;br /&gt;
        Me.txtData.Size = New System.Drawing.Size(300, 132)&lt;br /&gt;
        Me.txtData.TabIndex = 4&lt;br /&gt;
        Me.txtData.Text = resources.GetString(&amp;quot;txtData.Text&amp;quot;)&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)&lt;br /&gt;
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(329, 212)&lt;br /&gt;
        Me.Controls.Add(Me.cmdPrintWrapped)&lt;br /&gt;
        Me.Controls.Add(Me.Label1)&lt;br /&gt;
        Me.Controls.Add(Me.cmdPrint)&lt;br /&gt;
        Me.Controls.Add(Me.txtData)&lt;br /&gt;
        Me.Font = New System.Drawing.Font(&amp;quot;Tahoma&amp;quot;, 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;Wrapped Printing&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
        Me.PerformLayout()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Friend WithEvents cmdPrintWrapped As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents Label1 As System.Windows.Forms.Label&lt;br /&gt;
    Friend WithEvents cmdPrint As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents txtData As System.Windows.Forms.TextBox&lt;br /&gt;
    Private Sub cmdPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdPrint.Click&lt;br /&gt;
        Dim MyDoc As New PrintDocument()&lt;br /&gt;
        AddHandler MyDoc.PrintPage, AddressOf UnWrappedPrint&lt;br /&gt;
        Dim dlgSettings As New PrintDialog()&lt;br /&gt;
        dlgSettings.Document = MyDoc&lt;br /&gt;
        Dim Result As DialogResult&lt;br /&gt;
        Result = dlgSettings.ShowDialog()&lt;br /&gt;
        If Result = DialogResult.OK Then MyDoc.Print()&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub cmdPrintWrapped_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdPrintWrapped.Click&lt;br /&gt;
        Dim MyDoc As New PrintDocument()&lt;br /&gt;
        AddHandler MyDoc.PrintPage, AddressOf WrappedPrint&lt;br /&gt;
        Dim dlgSettings As New PrintDialog()&lt;br /&gt;
        dlgSettings.Document = MyDoc&lt;br /&gt;
        Dim Result As DialogResult&lt;br /&gt;
        Result = dlgSettings.ShowDialog()&lt;br /&gt;
        If Result = DialogResult.OK Then MyDoc.Print()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub UnWrappedPrint(ByVal sender As Object, ByVal e As PrintPageEventArgs)&lt;br /&gt;
        Dim MyFont As New Font(&amp;quot;Verdana&amp;quot;, 16)&lt;br /&gt;
        Dim x As Single = e.MarginBounds.Left&lt;br /&gt;
        Dim y As Single = e.MarginBounds.Top&lt;br /&gt;
        e.Graphics.DrawString(txtData.Text, MyFont, Brushes.Black, x, y)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub WrappedPrint(ByVal sender As Object, ByVal e As PrintPageEventArgs)&lt;br /&gt;
        Dim MyFont As New Font(&amp;quot;Verdana&amp;quot;, 16)&lt;br /&gt;
        Dim x As Single = e.MarginBounds.Left&lt;br /&gt;
        Dim y As Single = e.MarginBounds.Top&lt;br /&gt;
        e.Graphics.DrawString(txtData.Text, MyFont, Brushes.Black, e.MarginBounds, StringFormat.GenericDefault)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub WrappedPrint2(ByVal sender As Object, ByVal e As PrintPageEventArgs)&lt;br /&gt;
        Dim MyFont As New Font(&amp;quot;Verdana&amp;quot;, 16)&lt;br /&gt;
        Dim LineHeight As Single = MyFont.GetHeight(e.Graphics)&lt;br /&gt;
        Dim x As Single = e.MarginBounds.Left&lt;br /&gt;
        Dim y As Single = e.MarginBounds.Top&lt;br /&gt;
        Dim Line As String&lt;br /&gt;
        Dim ParsedLines As New ArrayList()&lt;br /&gt;
        Dim TextToPrint As String = txtData.Text&lt;br /&gt;
        Dim i As Integer&lt;br /&gt;
        Do&lt;br /&gt;
            Line &amp;amp;= TextToPrint.Chars(0)&lt;br /&gt;
            TextToPrint = TextToPrint.Substring(1)&lt;br /&gt;
            If Line.EndsWith(&amp;quot; &amp;quot;) Then&lt;br /&gt;
                If e.Graphics.MeasureString(Line, MyFont).Width &amp;gt; (e.PageBounds.Width - 300) Then&lt;br /&gt;
                    ParsedLines.Add(Line)&lt;br /&gt;
                    Line = &amp;quot;&amp;quot;&lt;br /&gt;
                End If&lt;br /&gt;
            End If&lt;br /&gt;
        Loop While TextToPrint &amp;lt;&amp;gt; &amp;quot;&amp;quot;&lt;br /&gt;
        ParsedLines.Add(Line)&lt;br /&gt;
        For Each Line In ParsedLines&lt;br /&gt;
            e.Graphics.DrawString(Line, MyFont, Brushes.Black, x, y)&lt;br /&gt;
            y += LineHeight&lt;br /&gt;
        Next&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&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>