Apply Your Knowledge

Exercises

11.1. Printing Multiple Columns

The methods of the Graphics object give you complete flexibility to place text or objects at any point in any drawing area. In this exercise, you use these positioning capabilities to print a database table in multiple columns. This exercise also shows how you can use the QueryPageSettings event to force the printed output to be in landscape mode.

Estimated time: 25 minutes

1.
Open a Visual C# .NET Windows application in the Visual Studio .NET Integrated Development Environment (IDE). Add a new form to the application.
2.
Add a Label control, a TextBox control (txtSQL), and two Button controls (btnPreview and btnPrint) to the form. Set the MultiLine property of the TextBox control ...

Get MCAD/MCSD.NET Training Guide (Exam 70-316): Developing and Implementing Windows®-Based Applications with Microsoft® Visual C#™ .NET and Microsoft® Visual Studio® .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.