home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / barcode / bsample2.frm < prev    next >
Text File  |  1993-10-31  |  10KB  |  354 lines

  1. VERSION 2.00
  2. Begin Form bsample2 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "BarCod Sample #2"
  5.    ClientHeight    =   4455
  6.    ClientLeft      =   1470
  7.    ClientTop       =   2445
  8.    ClientWidth     =   5295
  9.    Height          =   4860
  10.    Left            =   1410
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    ScaleHeight     =   4455
  14.    ScaleWidth      =   5295
  15.    Top             =   2100
  16.    Width           =   5415
  17.    Begin Barcode Barcode1 
  18.       BarWidth        =   8
  19.       Direction       =   0  'Left to Right
  20.       Height          =   495
  21.       Left            =   240
  22.       Style           =   3  '3 of 9
  23.       Top             =   4560
  24.       Width           =   4815
  25.    End
  26.    Begin TextBox Text1 
  27.       Height          =   285
  28.       Index           =   14
  29.       Left            =   3840
  30.       TabIndex        =   30
  31.       Top             =   3120
  32.       Width           =   1215
  33.    End
  34.    Begin TextBox Text1 
  35.       Height          =   285
  36.       Index           =   13
  37.       Left            =   3840
  38.       TabIndex        =   28
  39.       Top             =   2760
  40.       Width           =   1215
  41.    End
  42.    Begin TextBox Text1 
  43.       Height          =   285
  44.       Index           =   12
  45.       Left            =   3840
  46.       TabIndex        =   26
  47.       Top             =   2400
  48.       Width           =   1215
  49.    End
  50.    Begin TextBox Text1 
  51.       Height          =   285
  52.       Index           =   11
  53.       Left            =   3840
  54.       TabIndex        =   24
  55.       Top             =   2040
  56.       Width           =   1215
  57.    End
  58.    Begin TextBox Text1 
  59.       Height          =   285
  60.       Index           =   10
  61.       Left            =   3840
  62.       TabIndex        =   22
  63.       Top             =   1680
  64.       Width           =   1215
  65.    End
  66.    Begin TextBox Text1 
  67.       Height          =   285
  68.       Index           =   9
  69.       Left            =   3840
  70.       TabIndex        =   20
  71.       Top             =   1320
  72.       Width           =   1215
  73.    End
  74.    Begin TextBox Text1 
  75.       Height          =   285
  76.       Index           =   8
  77.       Left            =   1320
  78.       TabIndex        =   18
  79.       Top             =   3120
  80.       Width           =   1215
  81.    End
  82.    Begin TextBox Text1 
  83.       Height          =   285
  84.       Index           =   7
  85.       Left            =   1320
  86.       TabIndex        =   16
  87.       Top             =   2760
  88.       Width           =   1215
  89.    End
  90.    Begin TextBox Text1 
  91.       Height          =   285
  92.       Index           =   6
  93.       Left            =   1320
  94.       TabIndex        =   14
  95.       Top             =   2400
  96.       Width           =   1215
  97.    End
  98.    Begin TextBox Text1 
  99.       Height          =   285
  100.       Index           =   5
  101.       Left            =   1320
  102.       TabIndex        =   12
  103.       Top             =   2040
  104.       Width           =   1215
  105.    End
  106.    Begin TextBox Text1 
  107.       Height          =   285
  108.       Index           =   4
  109.       Left            =   1320
  110.       TabIndex        =   10
  111.       Top             =   1680
  112.       Width           =   1215
  113.    End
  114.    Begin TextBox Text1 
  115.       Height          =   285
  116.       Index           =   3
  117.       Left            =   1320
  118.       TabIndex        =   8
  119.       Top             =   1320
  120.       Width           =   1215
  121.    End
  122.    Begin TextBox Text1 
  123.       Height          =   285
  124.       Index           =   2
  125.       Left            =   1320
  126.       TabIndex        =   6
  127.       Top             =   960
  128.       Width           =   1215
  129.    End
  130.    Begin TextBox Text1 
  131.       Height          =   285
  132.       Index           =   1
  133.       Left            =   1320
  134.       TabIndex        =   4
  135.       Top             =   600
  136.       Width           =   1215
  137.    End
  138.    Begin TextBox Text1 
  139.       Height          =   285
  140.       Index           =   0
  141.       Left            =   1320
  142.       TabIndex        =   2
  143.       Top             =   240
  144.       Width           =   1215
  145.    End
  146.    Begin CommandButton Command2 
  147.       Caption         =   "Print Barcode Sample"
  148.       Height          =   375
  149.       Left            =   2760
  150.       TabIndex        =   1
  151.       Top             =   720
  152.       Width           =   2295
  153.    End
  154.    Begin CommandButton Command1 
  155.       Caption         =   "Exit Sample"
  156.       Height          =   375
  157.       Left            =   2760
  158.       TabIndex        =   0
  159.       Top             =   240
  160.       Width           =   2295
  161.    End
  162.    Begin Label Label2 
  163.       Caption         =   "The barcode control is below the edge of the window.  Since it is only used to print the barcode, it isn't necessary for the user to see it."
  164.       Height          =   615
  165.       Left            =   240
  166.       TabIndex        =   32
  167.       Top             =   3600
  168.       Width           =   4815
  169.    End
  170.    Begin Label Label1 
  171.       Caption         =   "Barcode 15"
  172.       Height          =   255
  173.       Index           =   14
  174.       Left            =   2760
  175.       TabIndex        =   31
  176.       Top             =   3180
  177.       Width           =   1095
  178.    End
  179.    Begin Label Label1 
  180.       Caption         =   "Barcode 14"
  181.       Height          =   255
  182.       Index           =   13
  183.       Left            =   2760
  184.       TabIndex        =   29
  185.       Top             =   2820
  186.       Width           =   1095
  187.    End
  188.    Begin Label Label1 
  189.       Caption         =   "Barcode 13"
  190.       Height          =   255
  191.       Index           =   12
  192.       Left            =   2760
  193.       TabIndex        =   27
  194.       Top             =   2460
  195.       Width           =   1095
  196.    End
  197.    Begin Label Label1 
  198.       Caption         =   "Barcode 12"
  199.       Height          =   255
  200.       Index           =   11
  201.       Left            =   2760
  202.       TabIndex        =   25
  203.       Top             =   2100
  204.       Width           =   1095
  205.    End
  206.    Begin Label Label1 
  207.       Caption         =   "Barcode 11"
  208.       Height          =   255
  209.       Index           =   10
  210.       Left            =   2760
  211.       TabIndex        =   23
  212.       Top             =   1740
  213.       Width           =   1095
  214.    End
  215.    Begin Label Label1 
  216.       Caption         =   "Barcode 10"
  217.       Height          =   255
  218.       Index           =   9
  219.       Left            =   2760
  220.       TabIndex        =   21
  221.       Top             =   1380
  222.       Width           =   1095
  223.    End
  224.    Begin Label Label1 
  225.       Caption         =   "Barcode 9"
  226.       Height          =   255
  227.       Index           =   8
  228.       Left            =   240
  229.       TabIndex        =   19
  230.       Top             =   3180
  231.       Width           =   1095
  232.    End
  233.    Begin Label Label1 
  234.       Caption         =   "Barcode 8"
  235.       Height          =   255
  236.       Index           =   7
  237.       Left            =   240
  238.       TabIndex        =   17
  239.       Top             =   2820
  240.       Width           =   1095
  241.    End
  242.    Begin Label Label1 
  243.       Caption         =   "Barcode 7"
  244.       Height          =   255
  245.       Index           =   6
  246.       Left            =   240
  247.       TabIndex        =   15
  248.       Top             =   2460
  249.       Width           =   1095
  250.    End
  251.    Begin Label Label1 
  252.       Caption         =   "Barcode 6"
  253.       Height          =   255
  254.       Index           =   5
  255.       Left            =   240
  256.       TabIndex        =   13
  257.       Top             =   2100
  258.       Width           =   1095
  259.    End
  260.    Begin Label Label1 
  261.       Caption         =   "Barcode 5"
  262.       Height          =   255
  263.       Index           =   4
  264.       Left            =   240
  265.       TabIndex        =   11
  266.       Top             =   1740
  267.       Width           =   1095
  268.    End
  269.    Begin Label Label1 
  270.       Caption         =   "Barcode 4"
  271.       Height          =   255
  272.       Index           =   3
  273.       Left            =   240
  274.       TabIndex        =   9
  275.       Top             =   1380
  276.       Width           =   1095
  277.    End
  278.    Begin Label Label1 
  279.       Caption         =   "Barcode 3"
  280.       Height          =   255
  281.       Index           =   2
  282.       Left            =   240
  283.       TabIndex        =   7
  284.       Top             =   990
  285.       Width           =   1095
  286.    End
  287.    Begin Label Label1 
  288.       Caption         =   "Barcode 2"
  289.       Height          =   255
  290.       Index           =   1
  291.       Left            =   240
  292.       TabIndex        =   5
  293.       Top             =   660
  294.       Width           =   1095
  295.    End
  296.    Begin Label Label1 
  297.       Caption         =   "Barcode 1"
  298.       Height          =   255
  299.       Index           =   0
  300.       Left            =   240
  301.       TabIndex        =   3
  302.       Top             =   300
  303.       Width           =   1095
  304.    End
  305. End
  306. Option Explicit
  307.  
  308. Sub Command1_Click ()
  309.     End
  310. End Sub
  311.  
  312. Sub Command2_Click ()
  313.     Dim I As Integer
  314.  
  315.     Screen.MousePointer = 11
  316.  
  317.     Printer.ScaleMode = 1
  318.     Barcode1.PrinterScaleMode = Printer.ScaleMode
  319.  
  320.     For I = 0 To 14
  321.         Barcode1.Caption = Text1(I).Text
  322.         Barcode1.PrinterLeft = 1440 + (3.25 * 1440) * Int(I / 8)
  323.         Barcode1.PrinterTop = 1440 + 1440 * (I Mod 8)
  324.         Barcode1.PrinterWidth = 3 * 1440
  325.         Barcode1.PrinterHeight = 720
  326.         Barcode1.PrinterHDC = Printer.hDC
  327.  
  328.         Printer.CurrentX = Barcode1.PrinterLeft
  329.         Printer.CurrentY = Barcode1.PrinterTop + Barcode1.PrinterHeight + 180
  330.         Printer.Print Barcode1.Displayed
  331.     Next I
  332.  
  333.     Printer.NewPage
  334.     Printer.EndDoc
  335.  
  336.     Screen.MousePointer = 0
  337. End Sub
  338.  
  339. Sub Form_Load ()
  340.     Dim I As Integer
  341.  
  342.     BSample2.Left = (Screen.Width - BSample2.Width) / 2
  343.     BSample2.Top = (Screen.Height - BSample2.Height) / 2
  344.  
  345.     For I = 0 To 14
  346.         Text1(I).Text = Chr$(I + 65) + Format$(I)
  347.     Next I
  348. End Sub
  349.  
  350. Sub Form_Unload (Cancel As Integer)
  351.     End
  352. End Sub
  353.  
  354.