home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Basic / Samples / VB_SMPL / VB_SMPL.ZIP / PRTPREV.EXE / GENPRINT.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-03-28  |  3.1 KB  |  102 lines

  1. VERSION 2.00
  2. Begin Form frmPreview 
  3.    Caption         =   "Print or Preview"
  4.    ClientHeight    =   7104
  5.    ClientLeft      =   528
  6.    ClientTop       =   1872
  7.    ClientWidth     =   7440
  8.    Height          =   7524
  9.    Left            =   480
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   7104
  12.    ScaleWidth      =   7440
  13.    Top             =   1500
  14.    Width           =   7536
  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     =   337
  37.       ScaleMode       =   3  'Pixel
  38.       ScaleWidth      =   444
  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     =   6588
  50.       ScaleWidth      =   5388
  51.       TabIndex        =   0
  52.       Top             =   240
  53.       Width           =   5412
  54.    End
  55. Sub Command1_Click ()
  56.    'Setup (Could be done at design time or in form load)
  57.    'Make printing stick
  58.    'Picture1.AutoRedraw = True
  59.    'Add a palette for 256 colors
  60.    'Picture1.Picture = LoadPicture("C:\VB\PASTEL.DIB")
  61.    'Setup hidden picture
  62.    'Picture2.AutoRedraw = False
  63.    'Picture2.ScaleMode = 3 'Pixels
  64.    'Picture2.Visible = False
  65.    'Picture2.AutoSize = True
  66.    'Picture2.Picture = LoadPicture("C:\VB\METAFILE\BUSINESS\PRINTER.WMF")
  67.    'This print job can go to the printer or the picture box
  68.    If Check1.Value = 0 Then PrinterFlag = True
  69.    PrintStartDoc Picture1, PrinterFlag, 8.5, 11
  70.    'All the subs use inches
  71.    PrintBox 1, 1, 6.5, 9
  72.    PrintLine 1.1, 2, 7.4, 2
  73.    PrintPicture Picture2, 1.1, 1.1, .8, .8
  74.    PrintFilledBox 2.1, 1.2, 5.2, .7, RGB(200, 200, 200)
  75.    PrintFontName "Arial"
  76.    PrintCurrentX 2.3
  77.    PrintCurrentY 1.3
  78.    PrintFontSize 35
  79.    PrintPrint "Visual Basic Printing"
  80.    For x = 3 To 5.5 Step .2
  81.       PrintCircle x, 3.5, .75
  82.    Next
  83.    PrintFontName "Courier New"
  84.    PrintFontSize 30
  85.    PrintCurrentX 1.5
  86.    PrintCurrentY 5
  87.    PrintPrint "It is possible to do"
  88.    PrintFontSize 24
  89.    PrintCurrentX 1.5
  90.    PrintCurrentY 6.5
  91.    PrintPrint "It is possible to do print"
  92.    PrintFontSize 18
  93.    PrintCurrentX 1.5
  94.    PrintCurrentY 8
  95.    PrintPrint "It is possible to do print preview"
  96.    PrintFontSize 12
  97.    PrintCurrentX 1.5
  98.    PrintCurrentY 9.5
  99.    PrintPrint "It is possible to do print preview with good results."
  100.    PrintEndDoc
  101. End Sub
  102.