Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class triangle
- Private Sub lblHome_Click(sender As Object, e As EventArgs) Handles lblHome.Click
- Me.Hide()
- Form1.Show()
- End Sub
- Private Sub lblExit_Click(sender As Object, e As EventArgs) Handles lblExit.Click
- Application.Exit()
- End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- 'declare varibles
- Dim Base As Double
- Dim Height As Double
- Dim Perimeter As Double
- Dim Area As Double
- Dim Hypo As Double
- 'initialize varibles
- Base = Double.Parse(txtBase.Text)
- Height = Double.Parse(txtHeight.Text)
- 'Hypo = Base + Height
- Hypo = Math.Sqrt(Math.Pow(Height, 2) + Math.Pow(Base, 2))
- Area = Base * Height / 2
- Perimeter = Height + Base + Hypo
- 'display varibles
- lblPerimeter.Text = Perimeter.ToString
- lblArea.Text = Area.ToString
- lblHypo.Text = Hypo.ToString
- End Sub
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- txtBase.Text = ""
- txtHeight.Text = ""
- lblHypo.Text = ""
- lblPerimeter.Text = ""
- lblArea.Text = ""
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement