mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-04 09:06:04 +02:00
* Merge winforms framework content to working branch (#14) * Breadcrumb / TOC / Move net5 to net folder (#15) * change path from net5 to net * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Add .net 5 winforms placeholder article (#16) * added some metadata and adjusted net5 placeholder * corrections * corrections * corrections * Test1 * Swapping landing page vs concept * fix links * Fix links * Fix desc
1.5 KiB
1.5 KiB
title, description, ms.date, dev_langs, helpviewer_keywords, ms.assetid
| title | description | ms.date | dev_langs | helpviewer_keywords | ms.assetid | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| How to: Print a Windows Form | Learn how to programmatically print a copy of the current Windows Form by using the CopyFromScreen method. | 03/30/2017 |
|
|
c8dff5f8-f56a-4c07-ae31-64643b31f8fc |
How to: Print a Windows Form
As part of the development process, you typically will want to print a copy of your Windows Form. The following code example shows how to print a copy of the current form by using the xref:System.Drawing.Graphics.CopyFromScreen%2A method.
Example
[!code-csharpSystem.Drawing.Graphics.CopyFromScreen#1] [!code-vbSystem.Drawing.Graphics.CopyFromScreen#1]
Robust Programming
The following conditions may cause an exception:
-
You do not have permission to access the printer.
-
There is no printer installed.
.NET Framework Security
In order to run this code example, you must have permission to access the printer you use with your computer.