Advertisement
Guest User

Untitled

a guest
Mar 27th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. Public Class triangle
  2.  
  3. Private Sub lblHome_Click(sender As Object, e As EventArgs) Handles lblHome.Click
  4.  
  5. Me.Hide()
  6. Form1.Show()
  7.  
  8. End Sub
  9.  
  10. Private Sub lblExit_Click(sender As Object, e As EventArgs) Handles lblExit.Click
  11.  
  12. Application.Exit()
  13.  
  14. End Sub
  15.  
  16. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  17.  
  18. 'declare varibles
  19. Dim Base As Double
  20. Dim Height As Double
  21. Dim Perimeter As Double
  22. Dim Area As Double
  23. Dim Hypo As Double
  24.  
  25. 'initialize varibles
  26. Base = Double.Parse(txtBase.Text)
  27. Height = Double.Parse(txtHeight.Text)
  28. 'Hypo = Base + Height
  29. Hypo = Math.Sqrt(Math.Pow(Height, 2) + Math.Pow(Base, 2))
  30. Area = Base * Height / 2
  31. Perimeter = Height + Base + Hypo
  32.  
  33. 'display varibles
  34. lblPerimeter.Text = Perimeter.ToString
  35. lblArea.Text = Area.ToString
  36. lblHypo.Text = Hypo.ToString
  37.  
  38. End Sub
  39.  
  40. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  41.  
  42. txtBase.Text = ""
  43. txtHeight.Text = ""
  44. lblHypo.Text = ""
  45. lblPerimeter.Text = ""
  46. lblArea.Text = ""
  47.  
  48. End Sub
  49. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement