need any more info just post back
** DONE **
Edited by bluntknife, 19 September 2007 - 12:47 PM.
Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!
Edited by bluntknife, 19 September 2007 - 12:47 PM.
Public Class frmarea '**************************************************************************** '**************************************************************************** '** ** '** Project name : Area Calulator ** '** Project description : Use to calculate the areas of three shapes ** '** Author : Edward Hunkin ** '** Date : 18 September 2007 ** '** ** '**************************************************************************** '**************************************************************************** Dim a, b, c, area As Double Dim sentence As String Private Sub radrectangle_GotFocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radrectangle.CheckedChanged grprectangle.Visible = True grpcircle.Visible = False grptriangle.Visible = False End Sub Private Sub radcircle_GotFocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radcircle.CheckedChanged grprectangle.Visible = False grpcircle.Visible = True grptriangle.Visible = False End Sub Private Sub radtriangle_GotFocusd(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radtriangle.CheckedChanged grprectangle.Visible = False grpcircle.Visible = False grptriangle.Visible = True End Sub Private Sub btncalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncalculate.Click Dim a, b, c, s, d As Double a = 0 b = 0 c = 0 d = area = 0 Try If radrectangle.Checked = True Then a = txtlength.Text b = txtbreadth.Text area = (a * b) Call output() txtlength.Clear() txtbreadth.Clear() ElseIf radcircle.Checked = True Then a = txtradius.Text area = 3.142 * (a * a) Call output() txtradius.Clear() ElseIf radtriangle.Checked = True Then a = txtside1.Text b = txtside2.Text c = txtside3.Text s = (a + b + c) / 2 area = Math.Sqrt(s * (s - a) * (s - b) * (s - c)) Call output() txtside1.Clear() txtside2.Clear() txtside3.Clear() End If Catch ex As Exception MsgBox("Not enough information entered. Please try again") End Try End Sub Sub output() area.ToString("0.00") sentence = "The area of your shape is " & area & " Square cm" lblarea.Text = sentence End Sub End Class
area.ToString("0.00")
area = FormatNumber(area, 2)
area = area.ToString("0.00")
Edited by stettybet0, 23 September 2007 - 06:07 PM.
area = areatotal.tostring("0.00)
0 members, 0 guests, 0 anonymous users
Community Forum Software by IP.Board
Licensed to: Geeks to Go, Inc.