0% found this document useful (0 votes)
97 views2 pages

Assignment 2: Given Below Is A Form To Accept The Length and Breadth of A Rectangle and Calculate The Area and Perimeter

This document provides code for a form that calculates the area and perimeter of a rectangle. The form accepts length and breadth inputs from text boxes, calculates the area and perimeter using those values, and displays the results in labels. It also includes buttons to calculate, clear, and quit the form.

Uploaded by

lock_jaw30
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views2 pages

Assignment 2: Given Below Is A Form To Accept The Length and Breadth of A Rectangle and Calculate The Area and Perimeter

This document provides code for a form that calculates the area and perimeter of a rectangle. The form accepts length and breadth inputs from text boxes, calculates the area and perimeter using those values, and displays the results in labels. It also includes buttons to calculate, clear, and quit the form.

Uploaded by

lock_jaw30
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Assignment 2

Given below is a form to accept the length and breadth of a rectangle and calculate
the area and perimeter.

Control
Form1
Label1
Text1
Label2
Text2
Command1
Label3
Control
Label4
Label5
Label6
Command2
Command3

Property
Caption
Caption
(Name)
Text
Caption
(Name)
Text
(Name)
Caption
Caption
Property
(Name)
BorderStyle
Caption
Caption
(Name)
BorderStyle
Caption
(Name)
Caption
(Name)
Caption

Value
Area and Perimeter
Enter the Length
TxtLength
Enter the Breadth
txtBreadth
cmdCalculate
Calculate
Area of Rectangle
Value
lblArea
1-FixedSingle
Perimeter is
lblPerimeter
1-FixedSingle
cmdClear
&Clear
cmdQuit
&Quit

Fill in the code below:


(General Declarations)

Dim intLength, intBreadth As Integer


Dim intArea, intPerimeter As Integer
Private Sub cmdCalculate_Click( )
intLength=Val([Link])
intBreadth=Val([Link])
intArea= intLength * intBreadth
intPerimeter=2*( intLength + intBreadth)
[Link]= intArea
[Link]= intPerimeter
End Sub
Private Sub cmdClear_Click( )
[Link]=
[Link]=
[Link] =
[Link]=
End Sub
Private Sub cmdQuit_Click( )

End
End Sub

You might also like