Skip to content

Commit 003ad7f

Browse files
authored
Update Form1.cs
1 parent 16eed58 commit 003ad7f

File tree

1 file changed

+9
-7
lines changed
  • dotnet-desktop-guide/net/winforms/printing/snippets/how-to-print-windows-form/csharp

1 file changed

+9
-7
lines changed

dotnet-desktop-guide/net/winforms/printing/snippets/how-to-print-windows-form/csharp/Form1.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ private void Button1_Click(object sender, EventArgs e)
1515
memoryImage = new Bitmap(s.Width, s.Height, myGraphics);
1616
Graphics memoryGraphics = Graphics.FromImage(memoryImage);
1717
memoryGraphics.CopyFromScreen(this.Location.X, this.Location.Y, 0, 0, s);
18-
18+
1919
printDocument1.Print();
20-
2120
}
22-
private void PrintDocument1_PrintPage(System.Object sender,
23-
System.Drawing.Printing.PrintPageEventArgs e) =>
24-
e.Graphics.DrawImage(memoryImage, 0, 0);
25-
21+
22+
private void PrintDocument1_PrintPage(
23+
System.Object sender,
24+
System.Drawing.Printing.PrintPageEventArgs e)
25+
{
26+
e.Graphics.DrawImage(memoryImage, 0, 0);
27+
}
2628
}
27-
}
29+
}

0 commit comments

Comments
 (0)