Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using/creating 4 VB Classes, create a single Windows Form application to calcula

ID: 3672909 • Letter: U

Question

Using/creating 4 VB Classes, create a single Windows Form application to calculate the centroid and area of the 3 common shapes below: The centroid of a square or rectangle is located at a distance of 1/2 its height and 1/2 its base. The centroid of a right triangle is located at a distance of 1/3 its height and 1/3 its base. Create a Base (Parent) Class named dsShape containing 3 properties (Base, Height, Diameter) Create an additional 3 derived sub classes named dsSquare, dsTriangle, dsCirde which Inherits the properties of the Base Class. For each of the derived classes, create 3 methods (functions) calculate the centroid (X and Y) and the Area In a Windows Form 1, create an instance (object) for each derived class named obiSquare. obiTriangle. obiCircle For example: Dim objSquare as New dsSquare

Explanation / Answer

Here code for the four classes

**********************************************************************

1.clsCircle

Imports System.Text
Imports System.Linq
Imports System.Drawing.Text
Imports System.Collections.Generic
Imports System

Namespace OOPApplication
Public Class clsCircle
Inherits clsShape
Public Sub New(objLocalShape As clsShape)

MyBase.New(objLocalShape)
End Sub
Public Function CentX() As Decimal
'Centriod of Circle for X is its Radius. In our Case it is Diameter/2
Return Diameter / 2
End Function

Public Function CentY() As Decimal
'Centriod of Circle for Y is its Radius. In our Case it is Diameter/2
Return Diameter / 2
End Function

Public Function Area() As Decimal
'Area of Circle is pi*D
Return [Decimal].Multiply(3.14159265D, Diameter)
End Function

End Class
End Namespace

***********************************************************************

2.clsShape

Imports System.Text
Imports System.Linq
Imports System.Drawing.Text
Imports System.Collections.Generic
Imports System
Namespace OOPApplication
Public Class clsShape
Private baseBaseValue As Decimal = 0D
Private baseHeightValue As Decimal = 0D
Private baseDiamterValue As Decimal = 0D

Public Property Base() As Decimal
Get
Return Me.baseBaseValue
End Get
Set(value As Decimal)
Me.baseBaseValue = value
End Set
End Property
Public Property Height() As Decimal
Get
Return Me.baseHeightValue
End Get
Set(value As Decimal)
Me.baseHeightValue = value
End Set
End Property
Public Property Diameter() As Decimal
Get
Return Me.baseDiamterValue
End Get
Set(value As Decimal)
Me.baseDiamterValue = value
End Set
End Property

Public Sub New(objClsShape As clsShape)

Me.baseBaseValue = objClsShape.Base
Me.baseHeightValue = objClsShape.Height
Me.baseDiamterValue = objClsShape.Diameter
End Sub

Public Sub New()
End Sub

End Class
End Namespace

*****************************************************

3.clsSquare

Imports System.Windows.Forms
Imports System.Text
Imports System.Linq
Imports System.Collections.Generic
Imports System
Namespace OOPApplication
Public Class clsSquare
Inherits clsShape

Public Sub New(objLocalShape As clsShape)

MyBase.New(objLocalShape)
End Sub

Public Function CentX() As Decimal
'Centriod of Square for X is base/2
Return Base / 2
End Function

Public Function CentY() As Decimal
'Centriod of Square for Y is height/2
Return Height / 2
End Function

Public Function Area() As Decimal
'Area of Square is base * height
Return Base * Height
End Function
End Class
End Namespace

*******************************************************************************************************

4.clsTriangle

Imports System.Text
Imports System.Linq
Imports System.Collections.Generic
Imports System

Namespace OOPApplication
Public Class clsTriangle
Inherits clsShape
Public Sub New(objLocalShape As clsShape)

MyBase.New(objLocalShape)
End Sub

Public Function CentX() As Decimal
'Centriod of Triangle for X is base/3
Return Base / 3
End Function

Public Function CentY() As Decimal
'Centriod of Triangle for Y is height/3
Return Height / 3
End Function

Public Function Area() As Decimal
'Area of Triangle is (base * height)/2
Return (Base * Height) / 2
End Function
End Class
End Namespace

***********************************************************************************************

Here is the code for form1

Imports System.Windows.Forms
Imports System.Text
Imports System.Security.Cryptography.X509Certificates
Imports System.Linq
Imports System.Globalization
Imports System.Drawing
Imports System.Data
Imports System.ComponentModel
Imports System.Collections.Generic
Imports System
Imports OOPApplication.OOPApplication

Public Class Form1
Public ObjShape As New clsShape()

Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click
'Get the Values for the FORM UI and assing to Class object Property;
Dim tempBaseValue As Decimal = 0D
Dim tempHeightValue As Decimal = 0D
Dim tempDiameterValue As Decimal = 0D
  
Decimal.TryParse(txtEnterBaseValue.Text, tempBaseValue)
Decimal.TryParse(txtEnterHeightValue.Text, tempHeightValue)
Decimal.TryParse(txtEnterDiameterValue.Text, tempDiameterValue)

'Creating Object for clsShape and assign the Enter Value to Object Properties
ObjShape = New clsShape()
ObjShape.Base = tempBaseValue
ObjShape.Height = tempHeightValue
ObjShape.Diameter = tempDiameterValue

'Calculate for Square and pass the object for clsshape to Class Constructor for assigning the base class properties.
Dim objSquare As New clsSquare(ObjShape)
txtSquareCentX.Text = objSquare.CentX().ToString(CultureInfo.InvariantCulture)
txtSquareCentY.Text = objSquare.CentY().ToString(CultureInfo.InvariantCulture)
txtSquareArea.Text = objSquare.Area().ToString(CultureInfo.InvariantCulture)

'Calculate for Triange and pass the object for clsshape to Class Constructor for assigning the base class properties.
Dim objTriangle As New clsTriangle(ObjShape)
txtTriangleCentX.Text = objTriangle.CentX().ToString(CultureInfo.InvariantCulture)
txtTriangleCentY.Text = objTriangle.CentY().ToString(CultureInfo.InvariantCulture)
txtTriangleArea.Text = objTriangle.Area().ToString(CultureInfo.InvariantCulture)

'Calculate for Circle and pass the object for clsshape to Class Constructor for assigning the base class properties.
Dim objCircle As New clsCircle(ObjShape)
txtCircleCentX.Text = objCircle.CentX().ToString(CultureInfo.InvariantCulture)
txtCircleCentY.Text = objCircle.CentY().ToString(CultureInfo.InvariantCulture)
txtCircleArea.Text = objCircle.Area().ToString(CultureInfo.InvariantCulture)
End Sub
End Class

*****************************************************************************************************************

Here is the code for Form1 designer

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.txtCircleArea = New System.Windows.Forms.TextBox()
Me.lblCircleArea = New System.Windows.Forms.Label()
Me.txtCircleCentY = New System.Windows.Forms.TextBox()
Me.lblCircleCentY = New System.Windows.Forms.Label()
Me.lblCircleCentX = New System.Windows.Forms.Label()
Me.grpBoxCircle = New System.Windows.Forms.GroupBox()
Me.txtCircleCentX = New System.Windows.Forms.TextBox()
Me.txtTriangleCentX = New System.Windows.Forms.TextBox()
Me.lblTriangeCentX = New System.Windows.Forms.Label()
Me.txtSquareArea = New System.Windows.Forms.TextBox()
Me.lblSquareArea = New System.Windows.Forms.Label()
Me.txtSquareCentY = New System.Windows.Forms.TextBox()
Me.lblSquareCentY = New System.Windows.Forms.Label()
Me.txtSquareCentX = New System.Windows.Forms.TextBox()
Me.lblTriangleArea = New System.Windows.Forms.Label()
Me.txtTriangleCentY = New System.Windows.Forms.TextBox()
Me.lblTriangleCentY = New System.Windows.Forms.Label()
Me.lblSquareCentX = New System.Windows.Forms.Label()
Me.grpBoxTriangle = New System.Windows.Forms.GroupBox()
Me.txtTriangleArea = New System.Windows.Forms.TextBox()
Me.grpBoxSquare = New System.Windows.Forms.GroupBox()
Me.btnCalculate = New System.Windows.Forms.Button()
Me.txtEnterDiameterValue = New System.Windows.Forms.TextBox()
Me.lblEnterDiamterValue = New System.Windows.Forms.Label()
Me.txtEnterHeightValue = New System.Windows.Forms.TextBox()
Me.lblEnterHeightValue = New System.Windows.Forms.Label()
Me.txtEnterBaseValue = New System.Windows.Forms.TextBox()
Me.lblEnterBaseValue = New System.Windows.Forms.Label()
Me.grpBoxCircle.SuspendLayout()
Me.grpBoxTriangle.SuspendLayout()
Me.grpBoxSquare.SuspendLayout()
Me.SuspendLayout()
'
'txtCircleArea
'
Me.txtCircleArea.Location = New System.Drawing.Point(21, 201)
Me.txtCircleArea.Name = "txtCircleArea"
Me.txtCircleArea.Size = New System.Drawing.Size(99, 21)
Me.txtCircleArea.TabIndex = 7
'
'lblCircleArea
'
Me.lblCircleArea.AutoSize = True
Me.lblCircleArea.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblCircleArea.Location = New System.Drawing.Point(18, 174)
Me.lblCircleArea.Name = "lblCircleArea"
Me.lblCircleArea.Size = New System.Drawing.Size(36, 15)
Me.lblCircleArea.TabIndex = 6
Me.lblCircleArea.Text = "Area"
'
'txtCircleCentY
'
Me.txtCircleCentY.Location = New System.Drawing.Point(21, 132)
Me.txtCircleCentY.Name = "txtCircleCentY"
Me.txtCircleCentY.Size = New System.Drawing.Size(99, 21)
Me.txtCircleCentY.TabIndex = 5
'
'lblCircleCentY
'
Me.lblCircleCentY.AutoSize = True
Me.lblCircleCentY.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblCircleCentY.Location = New System.Drawing.Point(18, 105)
Me.lblCircleCentY.Name = "lblCircleCentY"
Me.lblCircleCentY.Size = New System.Drawing.Size(58, 15)
Me.lblCircleCentY.TabIndex = 4
Me.lblCircleCentY.Text = "Cent (Y)"
'
'lblCircleCentX
'
Me.lblCircleCentX.AutoSize = True
Me.lblCircleCentX.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblCircleCentX.Location = New System.Drawing.Point(18, 36)
Me.lblCircleCentX.Name = "lblCircleCentX"
Me.lblCircleCentX.Size = New System.Drawing.Size(59, 15)
Me.lblCircleCentX.TabIndex = 2
Me.lblCircleCentX.Text = "Cent (X)"
'
'grpBoxCircle
'
Me.grpBoxCircle.Controls.Add(Me.txtCircleArea)
Me.grpBoxCircle.Controls.Add(Me.lblCircleArea)
Me.grpBoxCircle.Controls.Add(Me.txtCircleCentY)
Me.grpBoxCircle.Controls.Add(Me.lblCircleCentY)
Me.grpBoxCircle.Controls.Add(Me.txtCircleCentX)
Me.grpBoxCircle.Controls.Add(Me.lblCircleCentX)
Me.grpBoxCircle.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.grpBoxCircle.Location = New System.Drawing.Point(380, 292)
Me.grpBoxCircle.Name = "grpBoxCircle"
Me.grpBoxCircle.Size = New System.Drawing.Size(145, 247)
Me.grpBoxCircle.TabIndex = 19
Me.grpBoxCircle.TabStop = False
Me.grpBoxCircle.Text = "Circle"
'
'txtCircleCentX
'
Me.txtCircleCentX.Location = New System.Drawing.Point(21, 63)
Me.txtCircleCentX.Name = "txtCircleCentX"
Me.txtCircleCentX.Size = New System.Drawing.Size(99, 21)
Me.txtCircleCentX.TabIndex = 3
'
'txtTriangleCentX
'
Me.txtTriangleCentX.Location = New System.Drawing.Point(21, 63)
Me.txtTriangleCentX.Name = "txtTriangleCentX"
Me.txtTriangleCentX.Size = New System.Drawing.Size(99, 21)
Me.txtTriangleCentX.TabIndex = 3
'
'lblTriangeCentX
'
Me.lblTriangeCentX.AutoSize = True
Me.lblTriangeCentX.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblTriangeCentX.Location = New System.Drawing.Point(18, 36)
Me.lblTriangeCentX.Name = "lblTriangeCentX"
Me.lblTriangeCentX.Size = New System.Drawing.Size(59, 15)
Me.lblTriangeCentX.TabIndex = 2
Me.lblTriangeCentX.Text = "Cent (X)"
'
'txtSquareArea
'
Me.txtSquareArea.Location = New System.Drawing.Point(21, 201)
Me.txtSquareArea.Name = "txtSquareArea"
Me.txtSquareArea.Size = New System.Drawing.Size(99, 21)
Me.txtSquareArea.TabIndex = 7
'
'lblSquareArea
'
Me.lblSquareArea.AutoSize = True
Me.lblSquareArea.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblSquareArea.Location = New System.Drawing.Point(18, 174)
Me.lblSquareArea.Name = "lblSquareArea"
Me.lblSquareArea.Size = New System.Drawing.Size(36, 15)
Me.lblSquareArea.TabIndex = 6
Me.lblSquareArea.Text = "Area"
'
'txtSquareCentY
'
Me.txtSquareCentY.Location = New System.Drawing.Point(21, 132)
Me.txtSquareCentY.Name = "txtSquareCentY"
Me.txtSquareCentY.Size = New System.Drawing.Size(99, 21)
Me.txtSquareCentY.TabIndex = 5
'
'lblSquareCentY
'
Me.lblSquareCentY.AutoSize = True
Me.lblSquareCentY.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblSquareCentY.Location = New System.Drawing.Point(18, 105)
Me.lblSquareCentY.Name = "lblSquareCentY"
Me.lblSquareCentY.Size = New System.Drawing.Size(58, 15)
Me.lblSquareCentY.TabIndex = 4
Me.lblSquareCentY.Text = "Cent (Y)"
'
'txtSquareCentX
'
Me.txtSquareCentX.Location = New System.Drawing.Point(21, 63)
Me.txtSquareCentX.Name = "txtSquareCentX"
Me.txtSquareCentX.Size = New System.Drawing.Size(99, 21)
Me.txtSquareCentX.TabIndex = 3
'
'lblTriangleArea
'
Me.lblTriangleArea.AutoSize = True
Me.lblTriangleArea.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblTriangleArea.Location = New System.Drawing.Point(18, 174)
Me.lblTriangleArea.Name = "lblTriangleArea"
Me.lblTriangleArea.Size = New System.Drawing.Size(36, 15)
Me.lblTriangleArea.TabIndex = 6
Me.lblTriangleArea.Text = "Area"
'
'txtTriangleCentY
'
Me.txtTriangleCentY.Location = New System.Drawing.Point(21, 132)
Me.txtTriangleCentY.Name = "txtTriangleCentY"
Me.txtTriangleCentY.Size = New System.Drawing.Size(99, 21)
Me.txtTriangleCentY.TabIndex = 5
'
'lblTriangleCentY
'
Me.lblTriangleCentY.AutoSize = True
Me.lblTriangleCentY.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblTriangleCentY.Location = New System.Drawing.Point(18, 105)
Me.lblTriangleCentY.Name = "lblTriangleCentY"
Me.lblTriangleCentY.Size = New System.Drawing.Size(58, 15)
Me.lblTriangleCentY.TabIndex = 4
Me.lblTriangleCentY.Text = "Cent (Y)"
'
'lblSquareCentX
'
Me.lblSquareCentX.AutoSize = True
Me.lblSquareCentX.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblSquareCentX.Location = New System.Drawing.Point(18, 36)
Me.lblSquareCentX.Name = "lblSquareCentX"
Me.lblSquareCentX.Size = New System.Drawing.Size(59, 15)
Me.lblSquareCentX.TabIndex = 2
Me.lblSquareCentX.Text = "Cent (X)"
'
'grpBoxTriangle
'
Me.grpBoxTriangle.Controls.Add(Me.txtTriangleArea)
Me.grpBoxTriangle.Controls.Add(Me.lblTriangleArea)
Me.grpBoxTriangle.Controls.Add(Me.txtTriangleCentY)
Me.grpBoxTriangle.Controls.Add(Me.lblTriangleCentY)
Me.grpBoxTriangle.Controls.Add(Me.txtTriangleCentX)
Me.grpBoxTriangle.Controls.Add(Me.lblTriangeCentX)
Me.grpBoxTriangle.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.grpBoxTriangle.Location = New System.Drawing.Point(197, 292)
Me.grpBoxTriangle.Name = "grpBoxTriangle"
Me.grpBoxTriangle.Size = New System.Drawing.Size(145, 247)
Me.grpBoxTriangle.TabIndex = 18
Me.grpBoxTriangle.TabStop = False
Me.grpBoxTriangle.Text = "Triangle"
'
'txtTriangleArea
'
Me.txtTriangleArea.Location = New System.Drawing.Point(21, 201)
Me.txtTriangleArea.Name = "txtTriangleArea"
Me.txtTriangleArea.Size = New System.Drawing.Size(99, 21)
Me.txtTriangleArea.TabIndex = 7
'
'grpBoxSquare
'
Me.grpBoxSquare.Controls.Add(Me.txtSquareArea)
Me.grpBoxSquare.Controls.Add(Me.lblSquareArea)
Me.grpBoxSquare.Controls.Add(Me.txtSquareCentY)
Me.grpBoxSquare.Controls.Add(Me.lblSquareCentY)
Me.grpBoxSquare.Controls.Add(Me.txtSquareCentX)
Me.grpBoxSquare.Controls.Add(Me.lblSquareCentX)
Me.grpBoxSquare.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.grpBoxSquare.Location = New System.Drawing.Point(22, 292)
Me.grpBoxSquare.Name = "grpBoxSquare"
Me.grpBoxSquare.Size = New System.Drawing.Size(145, 247)
Me.grpBoxSquare.TabIndex = 17
Me.grpBoxSquare.TabStop = False
Me.grpBoxSquare.Text = "Square"
'
'btnCalculate
'
Me.btnCalculate.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnCalculate.Location = New System.Drawing.Point(244, 225)
Me.btnCalculate.Name = "btnCalculate"
Me.btnCalculate.Size = New System.Drawing.Size(75, 23)
Me.btnCalculate.TabIndex = 16
Me.btnCalculate.Text = "Calculate"
Me.btnCalculate.UseVisualStyleBackColor = True
'
'txtEnterDiameterValue
'
Me.txtEnterDiameterValue.Location = New System.Drawing.Point(210, 179)
Me.txtEnterDiameterValue.MaxLength = 5
Me.txtEnterDiameterValue.Name = "txtEnterDiameterValue"
Me.txtEnterDiameterValue.Size = New System.Drawing.Size(154, 20)
Me.txtEnterDiameterValue.TabIndex = 15
'
'lblEnterDiamterValue
'
Me.lblEnterDiamterValue.AutoSize = True
Me.lblEnterDiamterValue.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblEnterDiamterValue.Location = New System.Drawing.Point(225, 152)
Me.lblEnterDiamterValue.Name = "lblEnterDiamterValue"
Me.lblEnterDiamterValue.Size = New System.Drawing.Size(144, 15)
Me.lblEnterDiamterValue.TabIndex = 14
Me.lblEnterDiamterValue.Text = "Enter Diameter Value"
'
'txtEnterHeightValue
'
Me.txtEnterHeightValue.Location = New System.Drawing.Point(210, 118)
Me.txtEnterHeightValue.MaxLength = 5
Me.txtEnterHeightValue.Name = "txtEnterHeightValue"
Me.txtEnterHeightValue.Size = New System.Drawing.Size(154, 20)
Me.txtEnterHeightValue.TabIndex = 13
'
'lblEnterHeightValue
'
Me.lblEnterHeightValue.AutoSize = True
Me.lblEnterHeightValue.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblEnterHeightValue.Location = New System.Drawing.Point(225, 91)
Me.lblEnterHeightValue.Name = "lblEnterHeightValue"
Me.lblEnterHeightValue.Size = New System.Drawing.Size(127, 15)
Me.lblEnterHeightValue.TabIndex = 12
Me.lblEnterHeightValue.Text = "Enter Height Value"
'
'txtEnterBaseValue
'
Me.txtEnterBaseValue.Location = New System.Drawing.Point(210, 54)
Me.txtEnterBaseValue.MaxLength = 5
Me.txtEnterBaseValue.Name = "txtEnterBaseValue"
Me.txtEnterBaseValue.Size = New System.Drawing.Size(154, 20)
Me.txtEnterBaseValue.TabIndex = 11
'
'lblEnterBaseValue
'
Me.lblEnterBaseValue.AutoSize = True
Me.lblEnterBaseValue.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblEnterBaseValue.Location = New System.Drawing.Point(225, 27)
Me.lblEnterBaseValue.Name = "lblEnterBaseValue"
Me.lblEnterBaseValue.Size = New System.Drawing.Size(117, 15)
Me.lblEnterBaseValue.TabIndex = 10
Me.lblEnterBaseValue.Text = "Enter Base Value"
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(543, 569)
Me.Controls.Add(Me.grpBoxCircle)
Me.Controls.Add(Me.grpBoxTriangle)
Me.Controls.Add(Me.grpBoxSquare)
Me.Controls.Add(Me.btnCalculate)
Me.Controls.Add(Me.txtEnterDiameterValue)
Me.Controls.Add(Me.lblEnterDiamterValue)
Me.Controls.Add(Me.txtEnterHeightValue)
Me.Controls.Add(Me.lblEnterHeightValue)
Me.Controls.Add(Me.txtEnterBaseValue)
Me.Controls.Add(Me.lblEnterBaseValue)
Me.Name = "Form1"
Me.Text = "OOP Application for Centriod and Area"
Me.grpBoxCircle.ResumeLayout(False)
Me.grpBoxCircle.PerformLayout()
Me.grpBoxTriangle.ResumeLayout(False)
Me.grpBoxTriangle.PerformLayout()
Me.grpBoxSquare.ResumeLayout(False)
Me.grpBoxSquare.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()

End Sub
Private WithEvents txtCircleArea As System.Windows.Forms.TextBox
Private WithEvents lblCircleArea As System.Windows.Forms.Label
Private WithEvents txtCircleCentY As System.Windows.Forms.TextBox
Private WithEvents lblCircleCentY As System.Windows.Forms.Label
Private WithEvents lblCircleCentX As System.Windows.Forms.Label
Private WithEvents grpBoxCircle As System.Windows.Forms.GroupBox
Private WithEvents txtCircleCentX As System.Windows.Forms.TextBox
Private WithEvents txtTriangleCentX As System.Windows.Forms.TextBox
Private WithEvents lblTriangeCentX As System.Windows.Forms.Label
Private WithEvents txtSquareArea As System.Windows.Forms.TextBox
Private WithEvents lblSquareArea As System.Windows.Forms.Label
Private WithEvents txtSquareCentY As System.Windows.Forms.TextBox
Private WithEvents lblSquareCentY As System.Windows.Forms.Label
Private WithEvents txtSquareCentX As System.Windows.Forms.TextBox
Private WithEvents lblTriangleArea As System.Windows.Forms.Label
Private WithEvents txtTriangleCentY As System.Windows.Forms.TextBox
Private WithEvents lblTriangleCentY As System.Windows.Forms.Label
Private WithEvents lblSquareCentX As System.Windows.Forms.Label
Private WithEvents grpBoxTriangle As System.Windows.Forms.GroupBox
Private WithEvents txtTriangleArea As System.Windows.Forms.TextBox
Private WithEvents grpBoxSquare As System.Windows.Forms.GroupBox
Private WithEvents btnCalculate As System.Windows.Forms.Button
Private WithEvents txtEnterDiameterValue As System.Windows.Forms.TextBox
Private WithEvents lblEnterDiamterValue As System.Windows.Forms.Label
Private WithEvents txtEnterHeightValue As System.Windows.Forms.TextBox
Private WithEvents lblEnterHeightValue As System.Windows.Forms.Label
Private WithEvents txtEnterBaseValue As System.Windows.Forms.TextBox
Private WithEvents lblEnterBaseValue As System.Windows.Forms.Label

End Class

Note:copy these content into the respective classes and copy the Form content.