article

Printing and spaces

Email
Submitted on: 1/7/2015 8:21:00 PM
By: Robin Thomas Benjamin McKay (from psc cd)  
Level: Intermediate
User Rating: By 5 Users
Compatibility: VB 5.0, VB 6.0
Views: 360
 
     The purpose of this article is to introduce the new user to the art of printing quickly and simply.

 
				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!


Other 9 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Intermediate category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.