I have been using C# for over a year, but just now am trying to implement printing. My questions are very simple, and I'd like to find some sample code that answers them. I have created (at design time) menu items for Page Setup, Print Preview, and Print; the following components: PrintDocument, PrintDialog, PrintPreviewDialog, PageSetupDialog, and have connected them appropriately. I have an event handler that draws the items to be printed. They are all lines and points, no text display or display of graphics files. Everything works, as far as it goes My questions are: In the printpage event hander, I gather that (if you have not applied any Transforms) that the unit for integer drawing commands is 1/100 inch. Is this correct? I want to scale the drawing to fill the page, and I know the range of values. Should I be using a ScaleTransform for this? What is the standard, straightforward way to store the PageSetup parameters in the registry so they are restored when the program is run again they will be restored? I know how to read/write the Registry. Should I be getting/setting to PrintDialog.DefaultPageSettings or somewhere else? Is there a standard way to to test for the case that a PC (such as a laptop) has no attached printer,so I can disable the menu items? There must be standard ways to address all these issues, but I haven't found it. A sample program that addresses these would be very helpful. Thanks in advance, Michael Bate
View Complete Post