Area of the Rectangle in VB6

By | 2019-11-14

Here is a very simple program that I wrote using VB to compute the area of the rectangle. The code is very short and easy to understand. What does the program will do is to ask the user to give length and breath of the rectangle and the our program will solve for it’s area.

Private Sub Command1_Click()
   Sum = Val(Form1.Text1.Text) * Val(Form1.Text2.Text)
   Label4.Caption = "The are of the rectagle is " & Sum & "."
End Sub

Private Sub Command2_Click()
   Form1.Text1.Text = ""
   Form1.Text2.Text = ""
   Form1.Label4.Caption = ""
   Form1.Text1.SetFocus
End Sub

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.