Matching Printer "Page Break" in PictureBox
Posted on 2000-05-04
I manually produce a report in my program using either Printer.Print or MyPictureBox.Print statements depending on the user's choice of whether he/she wants to print or preview the report. I would like to be able to produce pages in the picturebox that exactly match what is printed on the printer, in other words the same number of lines of print in both. I can't simply count the lines that go to the printer and use that in the picturebox processing because I don't do the printer logic unless the user requests Print. I only use one size font so I assumed I could come up with code that would work by useing the relationship between the Printer.ScaleHeight and the factor I get when I divide Printer.TextHeight("test") by MyPictureBox.Textheight("test") but I couldn't get it to work. Can someone help?