Re: Printing in VB6
From: Ken Halter (Ken_Halter_at_Use_Sparingly_Hotmail.com)
Date: 10/27/04
- Next message: Bob Butler: "Re: Properties that return Objects"
- Previous message: Ken Halter: "Re: Supporting multiple langugages"
- In reply to: Jonathan: "Printing in VB6"
- Next in thread: Larry Serflaten: "Re: Printing in VB6"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 27 Oct 2004 09:39:12 -0700
Jonathan 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?
To measure a single line, you can use the printer's TextHeight method.
> 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.
No experience... but see the 'HOWTO' article below.
> 3) Is there a way to preview what I am about to print? I can easily waste a
> lot of papper.
There are a whole bunch of Print Preview components on
planetsourcecode.com ..
> 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?
We use some of this code for printing. Basically, write the text to a
RichTextBox (multi font support built in) and then dump that box to the
printer.
HOWTO: Set Up the RichTextBox Control for WYSIWYG Printing
http://support.microsoft.com/default.aspx?scid=kb;en-us;146022
> Thanks for the help.
-- Ken Halter - MS-MVP-VB - http://www.vbsight.com Please keep all discussions in the groups..
- Next message: Bob Butler: "Re: Properties that return Objects"
- Previous message: Ken Halter: "Re: Supporting multiple langugages"
- In reply to: Jonathan: "Printing in VB6"
- Next in thread: Larry Serflaten: "Re: Printing in VB6"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|