Template Form for Print, Print Preview, and More

Forms and Controls

Version Compatibility: Visual Basic 6

More information:
The attached zip contains a form that you may want to use as a baseline for developing your applications or just add in. The form contains 2 picture boxes, two scroll bars, and a common dialog box, At first sight it appears to be a viewer, and it is, but it can be much more.

The form can be resized and the controls and values adjust accordingly. Adding controls to the document picture box can extend the screen giving you extra room and make your screen's resolution independent.

The Scroll bars are dynamic adjusting, appearing and disappearing as the document is resized in relation to the container.

A menu selection is available for setting the document and printer's orientation, as is a print previewer to show how to resize and proportion the document graphic within the container.

Some of the Possibilities

  • Add a show open function to the dialog and set the picture property and you have a graphic viewer
  • Shorten the document add graphics and code and you have a scrollable toolbar
  • Add draw methods and you have a graphics editor
  • Add print and graphics commands and you have a report viewer/Printer or even a custom grid.

Instructions: Click the link below to download the code. Select 'Save' from the IE popup dialog. Once downloaded, open the .zip file from your local drive using WinZip or a comparable program to view the contents.

Download startpt.zip