-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: priyanka_dotnet
Message 4 in Discussion
Hi,
The .NET Framework provides a PrintPreviewControl control to allow you to
graphically preview print content before it is actually sent to the printer.
myPrintPreview.Document = myPrintDocument;
The PrintDialog box allows users to set the PrinterSettings property of a
PrintDocument object at run time.
myPrintDialog.ShowDialog();
You print a document by calling the PrintDocument.Print method.
using System.Drawing.Printing; // Declare the PrintDocument object.
private PrintDocument docToPrint = new PrintDocument();
// This method will set properties on the PrintDialog object and display
the dialog.
private void PrintDoc_Click(System.Object sender,
System.EventArgs e)
{
// Allow the user to choose the page range.
myPrintDialog.AllowSomePages = true;
// Set the Document property to the PrintDocument for
// which the PrintPage Event has been handled. To display the
// dialog, either this property or the PrinterSettings property
// must be set
myPrintDialog.Document = docToPrint;
DialogResult result = myPrintDialog.ShowDialog();
// If the result is OK then print the document.
if (result==DialogResult.OK)
{
docToPrint.Print();
}
}
Cheers :)
Priyanka
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]