0% found this document useful (0 votes)
37 views

Coding: Private Sub Cmdcalculate Click

This code calculates the area of a rectangle when a button is clicked. It defines variables to store the length and width from text boxes, calculates the area by multiplying length and width, and displays the result in a label by concatenating a message with the area value.

Uploaded by

Sharon Chan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Coding: Private Sub Cmdcalculate Click

This code calculates the area of a rectangle when a button is clicked. It defines variables to store the length and width from text boxes, calculates the area by multiplying length and width, and displays the result in a label by concatenating a message with the area value.

Uploaded by

Sharon Chan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Coding

Private Sub cmdcalculate click()


Dim length, width, Area As Integer
Dim msg As string
Length=Val(txtlength.Text)
Width=Val(txtwidth.Text)
Area=length*width
Msg=The area of rectangle is
lblarea.Caption=msg & area
End Sub

You might also like