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 / CH11 / 11-2-1.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-20  |  2.8 KB  |  102 lines

  1. VERSION 5.00
  2. Begin VB.Form frmBenefits 
  3.    Caption         =   "Benefits Menu"
  4.    ClientHeight    =   2112
  5.    ClientLeft      =   1080
  6.    ClientTop       =   1488
  7.    ClientWidth     =   3108
  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     =   2112
  20.    ScaleWidth      =   3108
  21.    Begin VB.CheckBox chkMedical 
  22.       Caption         =   "Medical Plan ($25.25)"
  23.       Height          =   255
  24.       Left            =   120
  25.       TabIndex        =   3
  26.       Top             =   1200
  27.       Width           =   2295
  28.    End
  29.    Begin VB.CheckBox chkVision 
  30.       Caption         =   "Vision Plan ($1.50)"
  31.       Height          =   255
  32.       Left            =   120
  33.       TabIndex        =   2
  34.       Top             =   840
  35.       Width           =   1935
  36.    End
  37.    Begin VB.CheckBox chkDental 
  38.       Caption         =   "Dental Plan ($9.68)"
  39.       Height          =   255
  40.       Left            =   120
  41.       TabIndex        =   1
  42.       Top             =   480
  43.       Width           =   2055
  44.    End
  45.    Begin VB.CheckBox chkDrugs 
  46.       Caption         =   "Prescription Drug Plan ($12.51)"
  47.       Height          =   255
  48.       Left            =   120
  49.       TabIndex        =   0
  50.       Top             =   120
  51.       Width           =   3015
  52.    End
  53.    Begin VB.Label lblAmount 
  54.       Caption         =   "$0.00"
  55.       Height          =   255
  56.       Left            =   2280
  57.       TabIndex        =   5
  58.       Top             =   1680
  59.       Width           =   615
  60.    End
  61.    Begin VB.Label lblTotal 
  62.       Caption         =   "Total monthly payment:"
  63.       Height          =   255
  64.       Left            =   120
  65.       TabIndex        =   4
  66.       Top             =   1680
  67.       Width           =   2055
  68.    End
  69. Attribute VB_Name = "frmBenefits"
  70. Attribute VB_GlobalNameSpace = False
  71. Attribute VB_Creatable = False
  72. Attribute VB_PredeclaredId = True
  73. Attribute VB_Exposed = False
  74. Private Sub chkDental_Click()
  75.   Call Tally
  76. End Sub
  77. Private Sub chkDrugs_Click()
  78.   Call Tally
  79. End Sub
  80. Private Sub chkMedical_Click()
  81.   Call Tally
  82. End Sub
  83. Private Sub chkVision_Click()
  84.   Call Tally
  85. End Sub
  86. Private Sub Tally()
  87.   Dim sum As Single
  88.   If chkDrugs.Value = 1 Then
  89.       sum = sum + 12.51
  90.   End If
  91.   If chkDental.Value = 1 Then
  92.       sum = sum + 9.68
  93.   End If
  94.   If chkVision.Value = 1 Then
  95.       sum = sum + 1.5
  96.   End If
  97.   If chkMedical.Value = 1 Then
  98.       sum = sum + 25.25
  99.   End If
  100.   lblAmount.Caption = FormatCurrency(sum)
  101. End Sub
  102.