Sams Teach Yourself Visual Basic 6 in 24 Hours

Sams Teach Yourself Visual Basic 6 in 24 Hours

By Greg Perry

Q&A

  1. I use a network printer sometimes and a local printer at other times, so what do I do to my application to print to either printer?

    Absolutely nothing. Remember that your application sends all output to the Windows print spooler and not to a specific printer. When you see the Print dialog box (the dialog box you can produce with the Common Dialog Box control), you select the printer, and from there you can select either your network or local printer. Windows then determines the best way to get your application's output to that printer.

  2. What is the difference between Spc() and Tab()?

    Both functions send spaces to the Printer object, but the functions differ in their starting position. Spc() adds spaces from the printer's current position. Tab() adds enough spaces to move the printer head to that position on the line, no matter where the printer head currently rests. In addition, if you use a Tab() value such as Tab(20) but the printer is currently past position 20, Visual Basic adds another line and tabs to column position 20 on the new line.

Share ThisShare This

Informit Network