home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH7 / 7-1-1.FRM (.txt) next >
Encoding:
Visual Basic Form  |  1998-09-18  |  2.2 KB  |  74 lines

  1. VERSION 5.00
  2. Begin VB.Form frm7_1_1 
  3.    Caption         =   "Early World Series"
  4.    ClientHeight    =   1110
  5.    ClientLeft      =   1935
  6.    ClientTop       =   3330
  7.    ClientWidth     =   4710
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   1110
  20.    ScaleWidth      =   4710
  21.    Begin VB.PictureBox picWinner 
  22.       Height          =   255
  23.       Left            =   120
  24.       ScaleHeight     =   195
  25.       ScaleWidth      =   4395
  26.       TabIndex        =   3
  27.       Top             =   720
  28.       Width           =   4455
  29.    End
  30.    Begin VB.CommandButton cmdWhoWon 
  31.       Caption         =   "Who Won That Series?"
  32.       Height          =   495
  33.       Left            =   2400
  34.       TabIndex        =   2
  35.       Top             =   120
  36.       Width           =   2175
  37.    End
  38.    Begin VB.TextBox txtNumber 
  39.       Height          =   285
  40.       Left            =   1920
  41.       TabIndex        =   1
  42.       Top             =   240
  43.       Width           =   375
  44.    End
  45.    Begin VB.Label lblNumber 
  46.       Alignment       =   1  'Right Justify
  47.       Caption         =   "Number from 1 to 5:"
  48.       Height          =   255
  49.       Left            =   120
  50.       TabIndex        =   0
  51.       Top             =   240
  52.       Width           =   1695
  53.    End
  54. Attribute VB_Name = "frm7_1_1"
  55. Attribute VB_GlobalNameSpace = False
  56. Attribute VB_Creatable = False
  57. Attribute VB_PredeclaredId = True
  58. Attribute VB_Exposed = False
  59. 'Create array for five strings
  60. Dim teamName(5) As String
  61. Private Sub cmdWhoWon_Click()
  62.   Dim n As Integer
  63.   'Fill array with World Series Winners
  64.   teamName(1) = "Red Sox"
  65.   teamName(2) = "Giants"
  66.   teamName(3) = "White Sox"
  67.   teamName(4) = "Cubs"
  68.   teamName(5) = "Cubs"
  69.   'Access array of five strings
  70.   n = Val(txtNumber.Text)
  71.   picWinner.Cls
  72.   picWinner.Print "The "; teamName(n); " won World Series number"; n
  73. End Sub
  74.