tvance929

Can someone direct me how to keep printing the second and third pages

I have a printDoc and it prints just fine except that it stops at the end of the first page....

THANKS!



Re: Visual C# Express Edition My printing stops at the end of the first page...

JohnWein

Show your PrintPage code. Do you set e.HasMorePages to True





Re: Visual C# Express Edition My printing stops at the end of the first page...

tvance929

private void retirePrintButton_Click(object sender, EventArgs e)

{

if (retireDetailsRTB.Text != "")

{

PrintDialog dlg = new PrintDialog();

dlg.Document = printRetireDetails;

if (dlg.ShowDialog() == DialogResult.OK)

{

printRetireDetails.Print();

}

}

}

private void printRetireDetails_PrintPage_1(object sender, System.Drawing.Printing.PrintPageEventArgs e)

{

Font printFont = new Font("Courier New", 10);//("Courier New", 12);

e.Graphics.DrawString(retireDetailsRTB.Text, printFont, Brushes.Black, 0, 0);

}

DONT know about HasMorePages....

OKAY -- I see it now on the PrintPageEventArgs e ... could you show me how I would use it





Re: Visual C# Express Edition My printing stops at the end of the first page...

JohnWein

Wow! Printing isn't quite that simple. You have to at least measure the string and print what will fit on each page. There is a RTB print routine from Microsoft that you might want to use. Search for Rich Text Box printing on Microsoft.com.

Edit:

Actually, if you can use .NET Framework 3.0, it is almost that simple. Search Microsoft.com for Print RTB.

Otherwise seach Microsoft.com for Print RichTextBox.