<?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%2FGUI_Windows_Form%2FPrint_Dialog</id>
		<title>Csharp/C Sharp/GUI Windows Form/Print Dialog - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FGUI_Windows_Form%2FPrint_Dialog"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/Print_Dialog&amp;action=history"/>
		<updated>2026-04-29T16:37:04Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/Print_Dialog&amp;diff=86&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/GUI_Windows_Form/Print_Dialog&amp;diff=86&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:18Z</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/GUI_Windows_Form/Print_Dialog&amp;diff=87&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/Print_Dialog&amp;diff=87&amp;oldid=prev"/>
				<updated>2010-05-26T11:33:03Z</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;==Steps through the common dialogs. Does nothing else useful==&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;
/*&lt;br /&gt;
C# Programming Tips &amp;amp; Techniques&lt;br /&gt;
by Charles Wright, Kris Jamsa&lt;br /&gt;
Publisher: Osborne/McGraw-Hill (December 28, 2001)&lt;br /&gt;
ISBN: 0072193794&lt;br /&gt;
*/&lt;br /&gt;
// CmnDlgs.cs -- steps through the common dialogs. Does nothing else useful.&lt;br /&gt;
//&lt;br /&gt;
//               Compile this program with the following command line:&lt;br /&gt;
//                   C:&amp;gt;csc CmnDlgs.cs&lt;br /&gt;
using System;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Drawing.Printing;&lt;br /&gt;
namespace clsCommonDialogs&lt;br /&gt;
{&lt;br /&gt;
    public class CommonDialogs&lt;br /&gt;
    {&lt;br /&gt;
        [STAThread]&lt;br /&gt;
        static public void Main ()&lt;br /&gt;
        {&lt;br /&gt;
            // Create and display a Choose Color dialog box.&lt;br /&gt;
            ColorDialog cd = new ColorDialog ();&lt;br /&gt;
            cd.ShowDialog ();&lt;br /&gt;
            cd.Dispose ();&lt;br /&gt;
            &lt;br /&gt;
            // Create and display a Choose Font dialog box.&lt;br /&gt;
            FontDialog fd = new FontDialog ();&lt;br /&gt;
            fd.ShowDialog ();&lt;br /&gt;
            fd.Dispose ();&lt;br /&gt;
                &lt;br /&gt;
            // Create and display an Open File dialog box.&lt;br /&gt;
            OpenFileDialog ofd = new OpenFileDialog ();&lt;br /&gt;
            ofd.ShowDialog ();&lt;br /&gt;
            ofd.Dispose ();&lt;br /&gt;
            &lt;br /&gt;
            // Create and display a Save File dialog box.&lt;br /&gt;
            SaveFileDialog sfd = new SaveFileDialog();&lt;br /&gt;
            sfd.ShowDialog ();&lt;br /&gt;
            sfd.Dispose ();&lt;br /&gt;
            &lt;br /&gt;
            // Create and display a Page Setup dialog box.&lt;br /&gt;
            PrintDocument printDoc = new PrintDocument();&lt;br /&gt;
            PageSetupDialog psd = new PageSetupDialog ();&lt;br /&gt;
            psd.Document = printDoc;&lt;br /&gt;
            psd.ShowDialog ();&lt;br /&gt;
            psd.Dispose ();&lt;br /&gt;
            &lt;br /&gt;
            // Create and display an Print dialog box.&lt;br /&gt;
            PrintDialog pd = new PrintDialog ();&lt;br /&gt;
            pd.Document = printDoc;&lt;br /&gt;
            pd.ShowDialog ();&lt;br /&gt;
            pd.Dispose ();&lt;br /&gt;
            &lt;br /&gt;
            // Create and display an Print Preview File dialog box.&lt;br /&gt;
            // This dialog is not a part of the common dialog library.&lt;br /&gt;
            PrintPreviewDialog ppd = new PrintPreviewDialog ();&lt;br /&gt;
            ppd.ShowDialog ();&lt;br /&gt;
            ppd.Dispose ();&lt;br /&gt;
            printDoc.Dispose ();&lt;br /&gt;
        }&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;
==Using PrintPreviewDialog==&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;
using System.Drawing.Printing;&lt;br /&gt;
public class frmMain : System.Windows.Forms.Form {&lt;br /&gt;
    private System.Drawing.Printing.PrintDocument printDoc;&lt;br /&gt;
    private System.Windows.Forms.PrintPreviewDialog ppDialog;&lt;br /&gt;
    private System.Windows.Forms.Button btnPrint;&lt;br /&gt;
    public frmMain() {&lt;br /&gt;
        this.printDoc = new System.Drawing.Printing.PrintDocument();&lt;br /&gt;
        this.ppDialog = new System.Windows.Forms.PrintPreviewDialog();&lt;br /&gt;
        this.btnPrint = new System.Windows.Forms.Button();&lt;br /&gt;
        this.SuspendLayout();&lt;br /&gt;
        this.printDoc.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printDoc_PrintPage);&lt;br /&gt;
        this.ppDialog.AutoScrollMargin = new System.Drawing.Size(0, 0);&lt;br /&gt;
        this.ppDialog.AutoScrollMinSize = new System.Drawing.Size(0, 0);&lt;br /&gt;
        this.ppDialog.ClientSize = new System.Drawing.Size(400, 300);&lt;br /&gt;
        this.ppDialog.Enabled = true;&lt;br /&gt;
        this.ppDialog.Location = new System.Drawing.Point(195, 22);&lt;br /&gt;
        this.ppDialog.MaximumSize = new System.Drawing.Size(0, 0);&lt;br /&gt;
        this.ppDialog.Opacity = 1;&lt;br /&gt;
        this.ppDialog.TransparencyKey = System.Drawing.Color.Empty;&lt;br /&gt;
        this.ppDialog.Visible = false;&lt;br /&gt;
        this.btnPrint.Location = new System.Drawing.Point(52, 28);&lt;br /&gt;
        this.btnPrint.Text = &amp;quot;Print&amp;quot;;&lt;br /&gt;
        this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);&lt;br /&gt;
        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
        this.ClientSize = new System.Drawing.Size(176, 86);&lt;br /&gt;
        this.Controls.AddRange(new System.Windows.Forms.Control[] {&lt;br /&gt;
                                      this.btnPrint});&lt;br /&gt;
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;&lt;br /&gt;
        this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;&lt;br /&gt;
        this.ResumeLayout(false);&lt;br /&gt;
    }&lt;br /&gt;
    [STAThread]&lt;br /&gt;
    static void Main() {&lt;br /&gt;
        Application.Run(new frmMain());&lt;br /&gt;
    }&lt;br /&gt;
    private void printDoc_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) {&lt;br /&gt;
        PrinterSettings pSettings = new PrinterSettings();&lt;br /&gt;
        Font printFont = new Font(&amp;quot;Arial&amp;quot;, 12);&lt;br /&gt;
        int nTextPosY = e.MarginBounds.Top;&lt;br /&gt;
        int nTextPosX = e.MarginBounds.Left;&lt;br /&gt;
        int nHeight = (int)printFont.GetHeight(e.Graphics);&lt;br /&gt;
        foreach (string sPtr in PrinterSettings.InstalledPrinters) {&lt;br /&gt;
            pSettings.PrinterName = sPtr;&lt;br /&gt;
            if (pSettings.IsValid) {&lt;br /&gt;
                e.Graphics.DrawString(sPtr, printFont, Brushes.Black, nTextPosX, nTextPosY + 5);&lt;br /&gt;
                e.Graphics.DrawString(&amp;quot;Can Duplex: &amp;quot; + pSettings.CanDuplex.ToString(),&lt;br /&gt;
                    printFont, Brushes.Black, nTextPosX + 10, nTextPosY + (5 + nHeight));&lt;br /&gt;
                e.Graphics.DrawString(&amp;quot;Is Default: &amp;quot; + pSettings.IsDefaultPrinter.ToString(),&lt;br /&gt;
                    printFont, Brushes.Black, nTextPosX + 10, nTextPosY + (5 + nHeight * 2));&lt;br /&gt;
                e.Graphics.DrawString(&amp;quot;Is Plotter: &amp;quot; + pSettings.IsPlotter.ToString(),&lt;br /&gt;
                    printFont, Brushes.Black, nTextPosX + 10, nTextPosY + (5 + nHeight * 3));&lt;br /&gt;
                e.Graphics.DrawString(&amp;quot;Landscape Angle: &amp;quot; + pSettings.LandscapeAngle.ToString(),&lt;br /&gt;
                    printFont, Brushes.Black, nTextPosX + 10, nTextPosY + (5 + nHeight * 4));&lt;br /&gt;
                e.Graphics.DrawString(&amp;quot;Maximum Copies: &amp;quot; + pSettings.MaximumCopies.ToString(),&lt;br /&gt;
                    printFont, Brushes.Black, nTextPosX + 10, nTextPosY + (5 + nHeight * 5));&lt;br /&gt;
                e.Graphics.DrawString(&amp;quot;Maximum Page: &amp;quot; + pSettings.MaximumPage.ToString(),&lt;br /&gt;
                    printFont, Brushes.Black, nTextPosX + 10, nTextPosY + (5 + nHeight * 6));&lt;br /&gt;
                e.Graphics.DrawString(&amp;quot;Minimum Page: &amp;quot; + pSettings.MinimumPage.ToString(),&lt;br /&gt;
                    printFont, Brushes.Black, nTextPosX + 10, nTextPosY + (5 + nHeight * 7));&lt;br /&gt;
                e.Graphics.DrawString(&amp;quot;Supports Color: &amp;quot; + pSettings.SupportsColor.ToString(),&lt;br /&gt;
                    printFont, Brushes.Black, nTextPosX + 10, nTextPosY + (5 + nHeight * 8));&lt;br /&gt;
                nTextPosY = nTextPosY + ((5 + nHeight * 8) + nHeight);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    private void btnPrint_Click(object sender, System.EventArgs e) {&lt;br /&gt;
        ppDialog.Document = printDoc;&lt;br /&gt;
        ppDialog.ShowDialog();&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>