home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ User's Journal & Wi…eveloper's Journal Tools
/
C-C__Users_Journal_and_Windows_Developers_Journal_Tools_1997.iso
/
vbdemos
/
vbdemos.lzh
/
PRTHOWTO.TXT
< prev
next >
Wrap
Text File
|
1993-07-14
|
5KB
|
116 lines
This demo demonstrates the use of the Printer control
in VBLite. The demo allows you to select any printer to
print to, change the print settings, print text, graphical
shapes and bitmaps displayed on the screen and in a .bmp
file. It will also allow you to configure the print
dialog and select the font to use when printing text. In
addition, it will display the current printer settings, the
values of various properties associated with the printer
device context, the current font settings, and will allow
you to select the default printer as the current printer.
The Printer Control has the following capabilities:
(1) Selection of any printer installed in your system.
(2) Printer setup and configuration, even on the fly within
a print job.
(3) Printing of text using any available font that the
printer supports and will also pick the closest matching
font for those fonts that are not directly supported
by the printer.
(4) Printing of bitmaps stored in memory or in a file,
including .bmp and .dib files.
(5) Printing of points, lines, rectangles, rounded
rectangles, arcs, circles, ellipses, pies, and polygons.
(6) Implements an abort dialog and uses an abort procedure
while the print job is in progress just like all major
Windows applications.
All capabilities are implemented as properties and a couple
of events are available to trap errors that may occur
during the configuration or printing process.
Here is a step by step procedure for running this demo:
(1) Check to make sure that the current printer is the
printer that you want to print to by selecting
Print Setup.. from the File menu. This will display
the standard print setup dialog that you see in most
Windows applications. Here you can select the printer
you want to print to and any initial settings that you
want to use.
(2) In order to print text, graphical shapes or bitmap images
to the printer, go to the Print menu and select Text to
print text, Shapes to print shapes, DIB to print a .bmp
file or Bitmap to print a bitmap stored in memory. The
selection that you make will have a check mark beside it.
(3) Select Print... from the File menu to print what you have
selected from Step 2 above. This will display a standard
print dialog box that you see in most Windows applications
and select OK to start the print job. When the print
job starts, a print abort dialog box will appear which
allows you to cancel the print job in the middle of a
print job. Once the print job is done, the abort dialog
box will disappear and you can continue with running the
demo.
(4) When you are done with the demo, you can exit the program
by selecting Exit from the File menu.
(5) You can get help with running the demo by selecting How
To Run Demo... from the Help menu and will display this
text in a text box for you to view.
Other things that you can do with this demo include the
following:
(1) You can select the default settings for the controls in
the print dialog box by selecting Print Dialog... from
the Settings menu. This dialog will allow you to set
the settings of the print dialog box before displaying
it so you can limit what the user can select from the
print dialog box. You can set the default setting of the
Print What control to either All Pages, Selection, or
Range of Pages. The Selection control can be set, not
set, or disabled. The Page Numbers control can also be
set, not set, or disabled, the Print To File check box
can be disabled, hidden, checked, or not checked. And
the collate control can be set or not set. The FromPage
and ToPage text boxes allow you to set the beginning and
ending pages to print if the Range Of Pages button is
set in the print dialog box. The MinPage and MaxPages
text boxes allow you to set the minimum and maximum pages
that the document can have. And the NumberOfCopies text
box allows you to set the number of copies to print if
multiple copies are supported by the current printer.
(2) By selecting Printer from the Settings menu, you can
see what the current settings are for the selected
printer.
(3) By selecting Device Context from the Settings menu, you
can see the various settings of the properties associated
with the Printer device context.
(4) By selecting Current Font from the Settings menu, you
can see the current font settings that the printer
will use when printing text.
(5) By selecting Fonts... from the Settings menu, you can
select another font to use from the standard font
dialog box. All text subsequently displayed on the form
will also use this font also.
(6) By selecting Use Default Printer, you can change the
current printer to the default printer as defined in
the Windows Control Panel.