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 / CH5 / 5-3-1.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-19  |  2.2 KB  |  76 lines

  1. VERSION 5.00
  2. Begin VB.Form frmRace 
  3.    Caption         =   "Horse Race"
  4.    ClientHeight    =   2088
  5.    ClientLeft      =   2052
  6.    ClientTop       =   1740
  7.    ClientWidth     =   2220
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   7.8
  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     =   2088
  20.    ScaleWidth      =   2220
  21.    Begin VB.CommandButton cmdDescribe 
  22.       Caption         =   "Describe Position"
  23.       Height          =   495
  24.       Left            =   120
  25.       TabIndex        =   3
  26.       Top             =   720
  27.       Width           =   1935
  28.    End
  29.    Begin VB.TextBox txtPosition 
  30.       Height          =   285
  31.       Left            =   1680
  32.       TabIndex        =   1
  33.       Top             =   240
  34.       Width           =   375
  35.    End
  36.    Begin VB.PictureBox picOutcome 
  37.       Height          =   495
  38.       Left            =   120
  39.       ScaleHeight     =   444
  40.       ScaleWidth      =   1884
  41.       TabIndex        =   0
  42.       Top             =   1440
  43.       Width           =   1935
  44.    End
  45.    Begin VB.Label lblPosition 
  46.       Caption         =   "Finishing position (1, 2, 3, ...)"
  47.       Height          =   495
  48.       Left            =   120
  49.       TabIndex        =   2
  50.       Top             =   120
  51.       Width           =   1575
  52.    End
  53. Attribute VB_Name = "frmRace"
  54. Attribute VB_GlobalNameSpace = False
  55. Attribute VB_Creatable = False
  56. Attribute VB_PredeclaredId = True
  57. Attribute VB_Exposed = False
  58. Private Sub cmdDescribe_Click()
  59.   Dim position As Integer    'Selector
  60.   position = Val(txtPosition.Text)
  61.   picOutcome.Cls
  62.   Select Case position
  63.     Case 1
  64.       picOutcome.Print "Win"
  65.     Case 2
  66.       picOutcome.Print "Place"
  67.     Case 3
  68.       picOutcome.Print "Show"
  69.     Case 4, 5
  70.       picOutcome.Print "You almost placed"
  71.       picOutcome.Print "in the money."
  72.     Case Else
  73.       picOutcome.Print "Out of the money."
  74.     End Select
  75. End Sub
  76.