home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / code / print / prtprev / genprt.txt < prev    next >
Text File  |  1995-02-27  |  2KB  |  57 lines

  1.  
  2. Sub Command1_Click ()
  3.    
  4.    
  5.    'Setup (Could be done at design time or in form load)
  6.    'Make printing stick
  7.    'Picture1.AutoRedraw = True
  8.    'Add a palette for 256 colors
  9.    'Picture1.Picture = LoadPicture("C:\VB\PASTEL.DIB")
  10.    'Setup hidden picture
  11.    'Picture2.AutoRedraw = False
  12.    'Picture2.ScaleMode = 3 'Pixels
  13.    'Picture2.Visible = False
  14.    'Picture2.AutoSize = True
  15.    'Picture2.Picture = LoadPicture("C:\VB\METAFILE\BUSINESS\PRINTER.WMF")
  16.    
  17.  
  18.  
  19.    'This print job can go to the printer or the picture box
  20.    If Check1.Value = 0 Then PrinterFlag = True
  21.    PrintStartDoc Picture1, PrinterFlag, 8.5, 11
  22.    
  23.    'All the subs use inches
  24.    PrintBox 1, 1, 6.5, 9
  25.    PrintLine 1.1, 2, 7.4, 2
  26.    PrintPicture Picture2, 1.1, 1.1, .8, .8
  27.    PrintFilledBox 2.1, 1.2, 5.2, .7, RGB(200, 200, 200)
  28.    PrintFontName "Arial"
  29.    PrintCurrentX 2.3
  30.    PrintCurrentY 1.3
  31.    PrintFontSize 35
  32.    PrintPrint "Visual Basic Printing"
  33.    For x = 3 To 5.5 Step .2
  34.       PrintCircle x, 3.5, .75
  35.    Next
  36.    PrintFontName "Courier New"
  37.    PrintFontSize 30
  38.    PrintCurrentX 1.5
  39.    PrintCurrentY 5
  40.    PrintPrint "It is possible to do"
  41.    PrintFontSize 24
  42.    PrintCurrentX 1.5
  43.    PrintCurrentY 6.5
  44.    PrintPrint "It is possible to do print"
  45.    PrintFontSize 18
  46.    PrintCurrentX 1.5
  47.    PrintCurrentY 8
  48.    PrintPrint "It is possible to do print preview"
  49.    PrintFontSize 12
  50.    PrintCurrentX 1.5
  51.    PrintCurrentY 9.5
  52.    PrintPrint "It is possible to do print preview with good results."
  53.    PrintEndDoc
  54.  
  55. End Sub
  56.  
  57.