home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / code / print / prtprev / genprint.frm < prev    next >
Text File  |  1995-02-27  |  3KB  |  112 lines

  1. VERSION 2.00
  2. Begin Form frmPreview 
  3.    Caption         =   "Print or Preview"
  4.    ClientHeight    =   7110
  5.    ClientLeft      =   525
  6.    ClientTop       =   1875
  7.    ClientWidth     =   7440
  8.    Height          =   7635
  9.    Left            =   465
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   7110
  12.    ScaleWidth      =   7440
  13.    Top             =   1410
  14.    Width           =   7560
  15.    Begin CheckBox Check1 
  16.       Caption         =   "Pre&view"
  17.       Height          =   252
  18.       Left            =   5640
  19.       TabIndex        =   3
  20.       Top             =   3000
  21.       Width           =   1452
  22.    End
  23.    Begin CommandButton Command1 
  24.       Caption         =   "&Print"
  25.       Height          =   492
  26.       Left            =   5640
  27.       TabIndex        =   2
  28.       Top             =   3480
  29.       Width           =   1332
  30.    End
  31.    Begin PictureBox Picture2 
  32.       AutoSize        =   -1  'True
  33.       Height          =   4068
  34.       Left            =   5760
  35.       Picture         =   GENPRINT.FRX:0000
  36.       ScaleHeight     =   269
  37.       ScaleMode       =   3  'Pixel
  38.       ScaleWidth      =   355
  39.       TabIndex        =   1
  40.       Top             =   600
  41.       Visible         =   0   'False
  42.       Width           =   5352
  43.    End
  44.    Begin PictureBox Picture1 
  45.       AutoRedraw      =   -1  'True
  46.       Height          =   6612
  47.       Left            =   120
  48.       Picture         =   GENPRINT.FRX:0E94
  49.       ScaleHeight     =   6585
  50.       ScaleWidth      =   5385
  51.       TabIndex        =   0
  52.       Top             =   240
  53.       Width           =   5412
  54.    End
  55. End
  56.  
  57. Sub Command1_Click ()
  58.    
  59.    
  60.    'Setup (Could be done at design time or in form load)
  61.    'Make printing stick
  62.    'Picture1.AutoRedraw = True
  63.    'Add a palette for 256 colors
  64.    'Picture1.Picture = LoadPicture("C:\VB\PASTEL.DIB")
  65.    'Setup hidden picture
  66.    'Picture2.AutoRedraw = False
  67.    'Picture2.ScaleMode = 3 'Pixels
  68.    'Picture2.Visible = False
  69.    'Picture2.AutoSize = True
  70.    'Picture2.Picture = LoadPicture("C:\VB\METAFILE\BUSINESS\PRINTER.WMF")
  71.    
  72.  
  73.  
  74.    'This print job can go to the printer or the picture box
  75.    If Check1.Value = 0 Then PrinterFlag = True
  76.    PrintStartDoc Picture1, PrinterFlag, 8.5, 11
  77.    
  78.    'All the subs use inches
  79.    PrintBox 1, 1, 6.5, 9
  80.    PrintLine 1.1, 2, 7.4, 2
  81.    PrintPicture Picture2, 1.1, 1.1, .8, .8
  82.    PrintFilledBox 2.1, 1.2, 5.2, .7, RGB(200, 200, 200)
  83.    PrintFontName "Arial"
  84.    PrintCurrentX 2.3
  85.    PrintCurrentY 1.3
  86.    PrintFontSize 35
  87.    PrintPrint "Visual Basic Printing"
  88.    For x = 3 To 5.5 Step .2
  89.       PrintCircle x, 3.5, .75
  90.    Next
  91.    PrintFontName "Courier New"
  92.    PrintFontSize 30
  93.    PrintCurrentX 1.5
  94.    PrintCurrentY 5
  95.    PrintPrint "It is possible to do"
  96.    PrintFontSize 24
  97.    PrintCurrentX 1.5
  98.    PrintCurrentY 6.5
  99.    PrintPrint "It is possible to do print"
  100.    PrintFontSize 18
  101.    PrintCurrentX 1.5
  102.    PrintCurrentY 8
  103.    PrintPrint "It is possible to do print preview"
  104.    PrintFontSize 12
  105.    PrintCurrentX 1.5
  106.    PrintCurrentY 9.5
  107.    PrintPrint "It is possible to do print preview with good results."
  108.    PrintEndDoc
  109.  
  110. End Sub
  111.  
  112.