'formulario 1 panel principal
Private Sub Command1_Click()
Form1.Show
End Sub
Private Sub Command2_Click()
Form2.Show
End Sub
Private Sub Command3_Click()
Label1.Caption = MsgBox("Desarrollado por Emmanuel Breyaue. Dudas, sugerencias y opiniones enviar a emmanuelbreyaue[a]gmail.com", 0 + 48, "Acerca del programa")
End Sub
Private Sub Command4_Click()
End
End Sub
'formulario 2 superfice rectangular
Public incli As Boolean
Private Sub Form_Load()
Dim medida As String
medida = "Mts"
Form1.Caption = "Superficie Rectangular"
Label6.Caption = medida
Label7.Caption = medida
Label8.Caption = medida
Label9.Caption = medida
Text3.Text = 0
End Sub
Private Sub Command2_Click()
'borrar variables
Text1.Text = " "
Text2.Text = " "
Text3.Text = 0
Text4.Text = " "
Label1.Caption = " "
End Sub
Private Sub Command3_Click()
Form1.Hide
End Sub
Private Sub Option1_Click()
Text3.Text = 0
Text3.Enabled = False
incli = False
End Sub
Private Sub Option2_Click()
incli = True
Text3.Enabled = True
End Sub
Private Sub Command1_Click()
'definir variables
Dim vol As Double
Dim lg As Integer
Dim an As Integer
Dim ar As Double
Dim maxp As Double
Dim minp As Double
'asignar variables
lg = Text1.Text
an = Text2.Text
minp = Text3.Text
maxp = Text4.Text
If incli = True Then
'esta inclinado
ar = lg * (minp + maxp) / 2
vol = ar * an
Else
'no esta inclinado
ar = (lg * maxp) * an
vol = ar
End If
'mostrar resultado
Label1.Caption = "Resultado " & vol & "m3"
End Sub
'formulario 3 superficie cilindrica
Public pi As Double
Public incli As Boolean
Private Sub Command1_Click()
Dim altMax As Double
Dim altMin As Double
Dim dmt As Double
Dim rad As Double
Dim vol As Double
'calcular diametro
dmt = Text1.Text
rad = dmt / 2
altMax = Text3.Text
altMin = Text2.Text
'calcular Volumen
If incli = True Then
vol = (1 / 2) * pi * rad ^ 2 * (altMax + altMin)
Else
vol = (pi * rad ^ 2) * altMax
End If
'mostrar resultado
Label4.Caption = "Resultado" & vol & "m3"
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label4.Caption = ""
End Sub
Private Sub Command3_Click()
Form2.Hide
End Sub
Private Sub Form_Load()
pi = 3.14159265
Text2.Enabled = False
Label2.Enabled = False
End Sub
Private Sub Option1_Click()
Text2.Enabled = False
Text2.Text = ""
Label2.Enabled = False
incli = False
End Sub
Private Sub Option2_Click()
incli = True
Text2.Enabled = True
Label2.Enabled = True
End Sub
Comentarios sobre la versión: 0.9 (1)