You can use the WindowState property of the PrintPreviewDialog class to bring the PrintPreview maximized. To handle zooming, the PrintPreviewDialog has a property, PrintPreviewControl. PrintPreviewControl owns a Zoom property that allows you to set the zoom factor of the PrintPreview.
I am afraid there is not a very easy way to print a form. You may implement this function with the steps below:
1.Add a print function to your application.Todo this, you should add a PrintDocument component to your application. Pleasedrag a PrintDocument from the tool box to your form. After that, you shouldcreate a PrintDialog and add the code to print the document.privatevoid buttonPrint_Click(object sender, System.EventArgs e){PrintDialogprintDialog1 = new PrintDialog();printDialog1.Document = printDocument1;DialogResultresult = printDialog1.ShowDialog();if(result == DialogResult.OK){printDocument1.Print();}}Fordetailed information about print framework, please see 'Windows Forms PrintSupport' in the MSDN (October 2001).2.Draw the form when printing.Thisstep is a little complex. You should handle the PrintPage of the printDocument1and draw the form to the printer device. In the event you maycopy the form to an image and then draw it to the printer device. privatevoid printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgse){Graphicsgraphic = this.CreateGraphics();Sizes = this.Size;ImagememImage = new Bitmap(s.Width, s.Height, graphic);GraphicsmemGraphic = Graphics.FromImage(memImage);IntPtrdc1 = graphic.GetHdc();IntPtrdc2 = memGraphic.GetHdc();BitBlt(dc2,0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height,dc1, 0, 0, 13369376);graphic.ReleaseHdc(dc1);memGraphic.ReleaseHdc(dc2);e.Graphics.DrawImage(memImage,0,0);}Theabove referenced the article 'Screen Capturing a Form in .NET - Using GDIin GDI+' by Michael Gold. You may find it at:http://www.c-sharpcorner.com/Graphics/ScreenCaptFormMG.asp3.Declare the API function.Pleasenote the BitBlt function used in Step 2. It is an unmanaged function.You should use DllImportAttribute attribute to import it to your code.Although, this is the Step 3, you may perform this step any time.[System.Runtime.InteropServices.DllImportAttribute('gdi32.dll')]privatestatic extern bool BitBlt(IntPtrhdcDest, // handle to destination DCintnXDest, // x-coord of destination upper-left cornerintnYDest, // y-coord of destination upper-left cornerintnWidth, // width of destination rectangleintnHeight, // height of destination rectangleIntPtrhdcSrc, // handle to source DCintnXSrc, // x-coordinate of source upper-left cornerintnYSrc, // y-coordinate of source upper-left cornerSystem.Int32dwRop // raster operation code);Formore information about DllImportAttribute attribute please see:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemRuntimeInteropServicesDllImportAttributeClassTopic.asp
(from Lion Shi (lion_noreply@microsoft.com) on microsoft.public.dotnet.framework.windowsforms)