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-2.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-11-02  |  2.1 KB  |  71 lines

  1. VERSION 5.00
  2. Begin VB.Form frmRace 
  3.    Caption         =   "Horse Race"
  4.    ClientHeight    =   2085
  5.    ClientLeft      =   2055
  6.    ClientTop       =   1740
  7.    ClientWidth     =   2565
  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     =   2085
  20.    ScaleWidth      =   2565
  21.    Begin VB.CommandButton cmdDescribe 
  22.       Caption         =   "Describe Position"
  23.       Height          =   495
  24.       Left            =   120
  25.       TabIndex        =   3
  26.       Top             =   720
  27.       Width           =   2295
  28.    End
  29.    Begin VB.TextBox txtPosition 
  30.       Height          =   285
  31.       Left            =   1920
  32.       TabIndex        =   1
  33.       Top             =   240
  34.       Width           =   495
  35.    End
  36.    Begin VB.PictureBox picOutcome 
  37.       Height          =   495
  38.       Left            =   120
  39.       ScaleHeight     =   435
  40.       ScaleWidth      =   2235
  41.       TabIndex        =   0
  42.       Top             =   1440
  43.       Width           =   2295
  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
  60.   'Describe finishing positions in a horse race
  61.   position = Val(txtPosition.Text)
  62.   picOutcome.Cls
  63.   Select Case position
  64.     Case 1 To 3
  65.       picOutcome.Print "In the money."
  66.       picOutcome.Print "Congratulations"
  67.     Case Is > 3
  68.       picOutcome.Print "Not in the money."
  69.   End Select
  70. End Sub
  71.