Option Explicit
Private Sub cmdCalculateHypotenuse_Click()
Dim intSideA As Integer
Dim intSideB As Integer
Dim dblAnswer As double
intSideA = txtLength1.Text 'Gets user input
intSideB = txtLength2.Text 'Gets user input
dblAnswer = (intSideA ^ 2 + intSideB ^ 2) ^ 0.5
lblAnswer.Caption = dblAnswer
End Sub
Private Sub cmdDone_Click()
Unload Me
End Sub
Private Sub txtLength1_Change()
'clear the current answer when the user begins to type a new length
lblAnswer.Caption = ""
End Sub
Private Sub txtLength2_Change()
'clear the current answer when the user begins to type a new length
lblAnswer.Caption = ""
End Sub