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-3.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-18  |  2.2 KB  |  78 lines

  1. VERSION 5.00
  2. Begin VB.Form frm5_3_3 
  3.    Caption         =   "One, Two, Buckle My Shoe"
  4.    ClientHeight    =   1725
  5.    ClientLeft      =   1740
  6.    ClientTop       =   1725
  7.    ClientWidth     =   3480
  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     =   1725
  20.    ScaleWidth      =   3480
  21.    Begin VB.PictureBox picPhrase 
  22.       Height          =   255
  23.       Left            =   840
  24.       ScaleHeight     =   195
  25.       ScaleWidth      =   1755
  26.       TabIndex        =   3
  27.       Top             =   1320
  28.       Width           =   1815
  29.    End
  30.    Begin VB.TextBox txtNumber 
  31.       Height          =   375
  32.       Left            =   2280
  33.       TabIndex        =   1
  34.       Top             =   240
  35.       Width           =   375
  36.    End
  37.    Begin VB.CommandButton cmdInterpret 
  38.       Caption         =   "Interpret Number"
  39.       Height          =   495
  40.       Left            =   840
  41.       TabIndex        =   2
  42.       Top             =   720
  43.       Width           =   1815
  44.    End
  45.    Begin VB.Label lblEnterNum 
  46.       Caption         =   "Enter a number from 1 to 10"
  47.       Height          =   495
  48.       Left            =   840
  49.       TabIndex        =   0
  50.       Top             =   120
  51.       Width           =   1335
  52.    End
  53. Attribute VB_Name = "frm5_3_3"
  54. Attribute VB_GlobalNameSpace = False
  55. Attribute VB_Creatable = False
  56. Attribute VB_PredeclaredId = True
  57. Attribute VB_Exposed = False
  58. Private Sub cmdInterpret_Click()
  59.   Dim x As Integer, y As Integer, num As Integer
  60.   'One, Two, Buckle My Shoe
  61.   picPhrase.Cls
  62.   x = 2
  63.   y = 3
  64.   num = Val(txtNumber.Text)
  65.   Select Case num
  66.     Case y - x, x
  67.       picPhrase.Print "Buckle my shoe."
  68.     Case Is <= 4
  69.       picPhrase.Print "Shut the door."
  70.     Case x + y To x * y
  71.       picPhrase.Print "Pick up sticks."
  72.     Case 7, 8
  73.       picPhrase.Print "Lay them straight."
  74.     Case Else
  75.       picPhrase.Print "Start all over again."
  76.   End Select
  77. End Sub
  78.