From 206742ea2219f4c3337ec4574565db3e15bbeeb6 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 12 Jun 2024 14:02:32 -0700 Subject: [PATCH] Update how-to-print-windows-form.md --- .../winforms/printing/how-to-print-windows-form.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/dotnet-desktop-guide/net/winforms/printing/how-to-print-windows-form.md b/dotnet-desktop-guide/net/winforms/printing/how-to-print-windows-form.md index 93b84f63c9..82f24c4a4a 100644 --- a/dotnet-desktop-guide/net/winforms/printing/how-to-print-windows-form.md +++ b/dotnet-desktop-guide/net/winforms/printing/how-to-print-windows-form.md @@ -19,16 +19,14 @@ As part of the development process, you typically will want to print a copy of y ## Example -In the following example, a `Button` control named **Button1** is added to the form. When the **Button1** button is clicked, it saves the form to an image in memory, and then sends it to the `PrintDocument` component. The `PrintDocument` control, named **PrintDocument1** in this example, is also added to the form - The following example requires two components added to the form, with the following settings: -| Object | Property\Event | Value | -|-------------------|-------------|------------| -| **Button** | `Name` | `Button1` | -| | `Click` | `Button1_Click` | -| **PrintDocument** | `Name` | `PrintDocument1` | -| | `PrintPage` | `PrintDocument1_PrintPage` | +| Object | Property\Event | Value | +|-------------------|----------------|------------------| +| **Button** | `Name` | `Button1` | +| | `Click` | `Button1_Click` | +| **PrintDocument** | `Name` | `PrintDocument1` | +| | `PrintPage` | `PrintDocument1_PrintPage` | The code creates a `Graphics` object from the form and saves its contents to a `Bitmap` variable named `memoryImage`. The method is called, which invokes the event. The event handler draws the `memoryImage` bitmap on the `Graphics` object representing the printer page.