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 / CH3 / 3-6-3.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-11-02  |  2.4 KB  |  81 lines

  1. VERSION 5.00
  2. Begin VB.Form frm3_6_3 
  3.    Caption         =   "3-6-3"
  4.    ClientHeight    =   1425
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   5850
  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     =   1425
  20.    ScaleWidth      =   5850
  21.    Begin VB.PictureBox picHyp 
  22.       Height          =   375
  23.       Left            =   2520
  24.       ScaleHeight     =   315
  25.       ScaleWidth      =   3195
  26.       TabIndex        =   5
  27.       Top             =   960
  28.       Width           =   3255
  29.    End
  30.    Begin VB.CommandButton cmdComputeHyp 
  31.       Caption         =   "Compute Hypotenuse"
  32.       Height          =   495
  33.       Left            =   240
  34.       TabIndex        =   4
  35.       Top             =   840
  36.       Width           =   2055
  37.    End
  38.    Begin VB.TextBox txtSecond 
  39.       Height          =   285
  40.       Left            =   3840
  41.       TabIndex        =   3
  42.       Top             =   480
  43.       Width           =   1215
  44.    End
  45.    Begin VB.TextBox txtFirst 
  46.       Height          =   285
  47.       Left            =   3840
  48.       TabIndex        =   1
  49.       Top             =   120
  50.       Width           =   1215
  51.    End
  52.    Begin VB.Label lblSecond 
  53.       Caption         =   "Length of second leg of right triangle:"
  54.       Height          =   255
  55.       Left            =   480
  56.       TabIndex        =   2
  57.       Top             =   480
  58.       Width           =   3255
  59.    End
  60.    Begin VB.Label lblFirst 
  61.       Caption         =   "Length of first leg of right triangle:"
  62.       Height          =   255
  63.       Left            =   720
  64.       TabIndex        =   0
  65.       Top             =   120
  66.       Width           =   3015
  67.    End
  68. Attribute VB_Name = "frm3_6_3"
  69. Attribute VB_GlobalNameSpace = False
  70. Attribute VB_Creatable = False
  71. Attribute VB_PredeclaredId = True
  72. Attribute VB_Exposed = False
  73. Private Sub cmdComputeHyp_Click()
  74.   'Find the length of the hypotenuse of a right triangle
  75.   picHyp.Cls
  76.   leg1 = Val(txtFirst.Text)
  77.   leg2 = Val(txtSecond.Text)
  78.   hyp = Sqr(leg1 ^ 2 + leg2 ^ 2)
  79.   picHyp.Print "The length of the hypotenuse is"; hyp
  80. End Sub
  81.