Saturday, December 17, 2016

Area of the Circle in Visual Basic NET

Here is another simple program that I wrote using Microsoft Visual Basic NET to ask the user to give the radius of the circle and then our program will compute it's area based on the given radius value of the user.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.



Sample Program Output


Program Listing

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim compute_area_circle As Double
        compute_area_circle = (Val(TextBox1.Text) * Val(TextBox1.Text) * 3.1416)
        Label4.Text = "The Area of the Circle is " & Format(compute_area_circle, "0.00")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        Label4.Text = ""
        TextBox1.Focus()
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim result As DialogResult = MessageBox.Show("Do you want to quit?", _
                               "Quit Program", _
                               MessageBoxButtons.YesNo)

        If (result = DialogResult.Yes) Then
            End
        Else
            TextBox1.Text = ""
            Label4.Text = ""
            TextBox1.Focus()
        End If
    End Sub

    
End Class





No comments:

Post a Comment