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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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?
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

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!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.