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

Form1 Object Eventargs: 'Declaracion de Variables

This Visual Basic code defines event handler subroutines for buttons in a Windows form to calculate the area and perimeter of different shapes. When a calculation button is clicked, it declares variables to store input dimensions and output values, checks which shape radio button is selected, performs the appropriate area and perimeter formula calculations based on the shape, and displays the results.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views2 pages

Form1 Object Eventargs: 'Declaracion de Variables

This Visual Basic code defines event handler subroutines for buttons in a Windows form to calculate the area and perimeter of different shapes. When a calculation button is clicked, it declares variables to store input dimensions and output values, checks which shape radio button is selected, performs the appropriate area and perimeter formula calculations based on the shape, and displays the results.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
End
End Sub

Private Sub Btncalcular_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Btncalcular.Click
'DECLARACION DE VARIABLES
Dim B As Integer
Dim H As Integer
Dim I As Integer
Dim M As Integer
Dim N As Integer
Dim a As Integer
Dim d As Integer
Dim F As Integer
Dim g As Integer
Dim u As Integer
Dim j As Integer
Dim x As Integer
Dim y As Integer

Dim AREA, PERIMETRO As Integer

'INGRESO DE DATOS
B = Me.TxtBASE.Text
H = Me.TxtALTURA.Text
I = Me.TxtLADO1.Text
M = Me.TxtLADO2.Text
N = Me.TxtLADO3.Text
a = Me.TXTLADO.Text
d = Me.TXTBASE2.Text
F = Me.TXTALTURA2.Text
g = Me.txtmenor.Text
u = Me.txtmayor.Text
j = Me.TextBox3.Text
x = Me.txtbase3.Text
y = Me.txtaltura3.Text

'PROCESO
If RbTRIANGULO.Checked Then
AREA = (B * H) / 2
PERIMETRO = I + M + N
End If

If RbCuadrado.Checked Then
AREA = a * a
PERIMETRO = (4 * a)
End If
If RbRECTANGULO.Checked Then
AREA = d * F
PERIMETRO = 2 * d + 2 * F
End If
If RbROMBO.Checked Then
AREA = g * u / 2
PERIMETRO = 4 * j

End If
If RbROMBOIDE.Checked Then
AREA = x * y
PERIMETRO = 2 * x + 2 * y
End If
If RbTRAPECIO.Checked Then
AREA = (H * (B + K)) / 2
PERIMETRO = I + M + N + O

End If
If Rbpentago.Checked Then
AREA = (H * (B + K)) / 2
PERIMETRO = I + M + N + O

End If
'SALIDA

Me.TxtAREA.Text = AREA
Me.TxtPERIMETRO.Text = PERIMETRO

End Sub

Private Sub Label7_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Label7.Click

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load

End Sub
End Class

You might also like