Re: Printing in VB6
From: Larry Serflaten (serflaten_at_usinternet.com)
Date: 10/27/04
- Next message: Steve Thompson: "Need help with licensing information..."
- Previous message: William: "section break"
- In reply to: Jonathan: "Printing in VB6"
- Next in thread: Lee Peedin: "Re: Printing in VB6"
- Reply: Lee Peedin: "Re: Printing in VB6"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 27 Oct 2004 11:53:26 -0500
"Jonathan" <Jonathan@discussions.microsoft.com> wrote
> I have a few questions about printing in VB 6.
>
> 1) How do I determine how many lines of a font will fit on a page?
> Obviously, there will be less lines of 24 font on a page than 12 font. It
> would also depend on the font type and letter. An i is not as wide as a w.
> Are there any methods for calculating this or is it just trial and error?
Set up the device with the correct font, and use its TextWidth and TextHeight
properties to measure various strings. While width can vary in a non-proportional
font, the height usually does not, so getting the total lines should be a simple
calculation, dividing the ScaleHeight of the device, by the TextHeight of a line.
> 2) How can I add a picutre to the page to print? I have a few bitmaps and
> gif's that I would like to add.
The printer supports the PaintPicture method.
> 3) Is there a way to preview what I am about to print? I can easily waste a
> lot of papper.
How about directing your printing to a picturebox first?
>
> 4) Can I set the font of one line to be bold and 16 and the next line to be
> 12 and regular font? Before I was setting the font with Printer.Fontbold =
> true. Then I changed it to Printer.Fontbold = false. The whole document was
> not bold - I wanted the first part to be bold. Can sections of the page have
> different fonts in VB6? Or was I doing something wrong?
The Print command should reflect whatever the current settings are.
Although its an iterative process: Print/change/print/change/print ... etc...
LFS
- Next message: Steve Thompson: "Need help with licensing information..."
- Previous message: William: "section break"
- In reply to: Jonathan: "Printing in VB6"
- Next in thread: Lee Peedin: "Re: Printing in VB6"
- Reply: Lee Peedin: "Re: Printing in VB6"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|