Sunday, September 8, 2019

HOW TO CALCULATE AREA OF CIRCLE USING VB PROGRAMMING.

Hi Friends Today i will show you how you can be Calculate Area of Circle in VB(Visual Basic 6.0)


  • To Calculate Area of Circle you need to insert Two Label Control's.
  • And another Control's need to insert is  One Text box Control.
  • One Command button is placed to the form.
  • As Shown in Picture Arrange it.
  • The Second Label for Output or Display of Calculate Area of Circle. 
  • In this Example I used default names of Control.  
  • Also we concatenate the Strings value to show proper Output in Label Control. 

Coding of Area of Circle

Private Sub cmdClick_Click()
Dim r As Integer
Dim area As Double
r = Val(Text1.Text)
area = 3.14 * r * r
Label2.Caption = "Area of Circle is " & area
End Sub
Code Window

Output View

Design View

No comments:

Post a Comment