Advertisement
C_Volume2 VB function enhancement #70723

Printing and spaces

The purpose of this article is to introduce the new user to the art of printing quickly and simply.

AI

Ringkasan AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Kode Sumber
original-source
Many people believe VB to be a major pain as like other programming languages because they are too tech. So are most things if you think about it for long enough and you're new to it. Anyway, here is a simple way to print in visual basic and also introduce you to a neat printing method. I take no credit for this because it is an article I found elsewhere.

Create a new standard.exe

create two labels

do what you want with the labels. The name and the captions don't matter.

Now, create a button and change its caption to: &Print and its name to cmdPrint.

In the button's code window, type the following code:

Printer.Print label1.caption; spc(30); label2.caption

The above code must all be on 1 line.

Good. You've mastered a simple printing method.

You can, of course, manipulate the printing methods above to print documents in a snazzy manner. 

Before End Sub, type the following code:

Printer.Enddoc

This ensures the print job ends as you finish printing. Nice one!
Komentar Asli (3)
Dipulihkan dari Wayback Machine