Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Matching Printer "Page Break" in PictureBox

Posted on 2000-05-04
3
Medium Priority
?
172 Views
Last Modified: 2013-11-22
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?
0
Comment
Question by:Martin Liss
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
mcrider earned 200 total points
ID: 2777674
Try something like this:

Picture1.Height = Printer.Height
Picture1.Width = Printer.Width
Set Picture1.Font = Printer.Font

Then as you're printing look at the CurrentY Property.  If it's going to print in the footer margin you specify, you need to move to a new page...


Cheers!®©
0
 
LVL 49

Author Comment

by:Martin Liss
ID: 2941174
Comment accepted as answer
0
 
LVL 49

Author Comment

by:Martin Liss
ID: 2941175
It's not the whole answer, but it's the only one I've gotten.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question