From 003ad7f213ba8af3602718a93c3c06999cfdc523 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 12 Jun 2024 13:57:49 -0700 Subject: [PATCH] Update Form1.cs --- .../how-to-print-windows-form/csharp/Form1.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/dotnet-desktop-guide/net/winforms/printing/snippets/how-to-print-windows-form/csharp/Form1.cs b/dotnet-desktop-guide/net/winforms/printing/snippets/how-to-print-windows-form/csharp/Form1.cs index 8e087622f7..101e19dc37 100644 --- a/dotnet-desktop-guide/net/winforms/printing/snippets/how-to-print-windows-form/csharp/Form1.cs +++ b/dotnet-desktop-guide/net/winforms/printing/snippets/how-to-print-windows-form/csharp/Form1.cs @@ -15,13 +15,15 @@ private void Button1_Click(object sender, EventArgs e) memoryImage = new Bitmap(s.Width, s.Height, myGraphics); Graphics memoryGraphics = Graphics.FromImage(memoryImage); memoryGraphics.CopyFromScreen(this.Location.X, this.Location.Y, 0, 0, s); - + printDocument1.Print(); - } - private void PrintDocument1_PrintPage(System.Object sender, - System.Drawing.Printing.PrintPageEventArgs e) => - e.Graphics.DrawImage(memoryImage, 0, 0); - + + private void PrintDocument1_PrintPage( + System.Object sender, + System.Drawing.Printing.PrintPageEventArgs e) + { + e.Graphics.DrawImage(memoryImage, 0, 0); + } } -} \ No newline at end of file +}