Search Tools Links Login

Area of a Circle Calculator

Posted: 2019-12-15
By: BradyBotkin
Viewed: 140

Filed Under:

VB6 Code Cache, VB6 Math/Dates

No attachments for this post

This code allows the user to find the area of circle by clicking a command button and then typing in the radius of the circle.

It is very helpful to anyone working on a calculator project. I am also coming out with area of triangle and square.

  1. Place a command button in your form and name it Command1 and make the caption Area Of A Circle.
  2. Copy this code into the form...

Private Sub Command1_Click()

   Dim Radius
   Dim Area

   Radius = InputBox("Type In The Radius", "Radius")
   Area = 3.14 * (Radius * Radius)

   MsgBox Area, vbDefaultButton1, "Answer"

End Sub

Comments on this post

No comments have been added for this post.

You must be logged in to make a comment.