Teen Programmers Unite  
 

 

Return to forum top

Help with Visual Basic 6.0

Posted by milky [send private reply] at June 03, 2002, 10:06:17 PM

How do I print out a form in Visual Basi 6.0. I have written a basic shopping list program that has check boxes that people can tick. I want to be able to print a list of only the items I have ticked. Please help.

Posted by jay_dee [send private reply] at June 03, 2002, 11:14:50 PM

sorry...but when you say print...you mean out of the printer on to paper right?

Posted by metamorphic [send private reply] at June 04, 2002, 12:00:56 PM

don't think you can print a form to paper progmatically (you can only do this to my knowledge while still in visual studio) but you can print to paper. A better way would just be uses variables to check if the check boxes are selected or not and just print that out in plain text. to access the printer i think its either

lprint "some text"
or
lprinter "some text"

not sure

Posted by unknown_lamer [send private reply] at June 04, 2002, 04:16:56 PM

I thought Windows had something like Display Postscript where you can draw to a Windows Meta File and then print that? I think I read about it someplace...(then again, I could be hallucinating because I don't use Windows. I know that WINE implements this, and since WINE implements the windows api...)

Posted by sniperdav [send private reply] at June 04, 2002, 08:10:38 PM

say you have a control array called Checkboxes with 10 elements. Try this code:

************************************8

For x = 0 To 9
If Checkboxes(x).Value = 1 Then Printer.Print "Checkbox #" & CStr(x) & " is checked."
Next x

Printer.EndDoc

*************************************

This should print out lines telling which checkboxes are checked.

Email me (sniperdav@fp2k2.com) if you have any questions about this.

Posted by taubz [send private reply] at June 10, 2002, 09:29:26 PM

There's actually a "printForm" method, or something like that, that will print a form directly. :) Check the help. A keywork search would work pretty well.

- taubz

You must be logged in to post messages and see which you have already read.

Log on
Username:
Password:
Save for later automatic logon

Register as a new user
 
Copyright TPU 2002. See the Credits and About TPU for more information.