printing using form.Printform: Form is too small


i'm printing some simple text on labels using form.PrintForm. However, to use the full size of the paper, my form is too small. Using 1024x768, my form can;t get bigger than that, but it should be at least twice as big to use a full Din A4 sheet

- Does anyone know how to make a form that's bigger than your screen?


- Does anuone know how to handle this nicely?
Who is Participating?
KDivadConnect With a Mentor Commented:
It might be easier to use Printer.CurrentX and .CurrentY to set the Printer's next location and then send the text to the printer.
KDivad is right. PrintForm really isn't the right way to do this.

VB can move up the page as well as down. You have to position the .CurrentX/Y for each print command but it should work well. You can print down one column, move back to the top, print the next column, etc. Or you can print columns a row at a time.

The .TextWidth and .TextHeight properties allow you to adjust spacing on proportional fonts. Conventional counting spaces or tabbing to line up columns only works for mono-spaced fonts like Courier.

Use Printer.EndDoc to finish the print job.

heitAuthor Commented:
the printer. piece works fine, but i don't know how to print a single line on multiple lines, as if it were in a canvas. You said something about textwidth, but my editor says one should use it like this

a = Printer.TextWidth(mytext)

can  you explain this to me?
Never miss a deadline with

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Picture1.TextWidth/Form1.TextWidth/Printer.Textwidth all return the pixel length of the text you pass it based on the font name/size/etc. of the object.

What you need to do is 1. Check the length of the line using TextWidth. 2. If it is too long then use code to find the last space (or other natural divider) in the line. (In VB6, you can use InStrRev). 3. Now that you have the last space in the line, check the length of everything to the left of it. 3a. If it still too long, then try step 2 with what's left. 4. Print it.

It sounds a little complex, but it's not really.
heitAuthor Commented:
ok, i allready feared that i had to do it that way ... thanx, i'll fix the thing.

best wishes for the new millennium
You're Welcome!
All Courses

From novice to tech pro — start learning today.