Printing Sample

This sample application demonstrates how to print text and configure the printer.

Security Note

This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended.

To run this sample

  1. Click the Download Sample button on this page. In the File Download dialog, select Open.

  2. Save the files to your computer.

  3. In Visual Studio, select the File menu, then Open, then Project/Solution.

  4. Browse to the folder where you saved the files and select the solution file. This opens the solution in Visual Studio.

  5. Press F5.

To view the sample documentation

  1. In Solution Explorer, double-click the Documentation folder.

  2. If you are using Visual Basic Express Edition, right-click ReadMe.htm in the Documentation folder. Select View in Browser.

  3. If you are using another version of Visual Basic, double-click ReadMe.htm in the Documentation folder.

Demonstrates

  • The sample prints a few paragraphs of text, demonstrating print preview, print setup, and page setup.