0% found this document useful (0 votes)
15 views4 pages

Public Class Private Sub Byval As Byval As Handles End Sub Private Sub Byval As Byval As Handles Me

The document contains code for three forms (classes) in Visual Basic: 1. Frmmenu contains buttons to navigate between the forms and close the program. 2. Frmgravedad calculates gravitational force based on mass and distance values entered by the user. 3. Frmtuberias calculates pressure loss in pipes based on fluid flow rate, diameter, and length values entered by the user.

Uploaded by

baterod3
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)
15 views4 pages

Public Class Private Sub Byval As Byval As Handles End Sub Private Sub Byval As Byval As Handles Me

The document contains code for three forms (classes) in Visual Basic: 1. Frmmenu contains buttons to navigate between the forms and close the program. 2. Frmgravedad calculates gravitational force based on mass and distance values entered by the user. 3. Frmtuberias calculates pressure loss in pipes based on fluid flow rate, diameter, and length values entered by the user.

Uploaded by

baterod3
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/ 4

Public Class Frmmenu

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


System.EventArgs) Handles Label1.Click

End Sub

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


System.EventArgs) Handles Cmduno.Click
Me.Hide()
Frmgravedad.Show()

End Sub

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


System.EventArgs) Handles Cmddos.Click
Me.Hide()
Frmtuberias.Show()

End Sub

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


System.EventArgs) Handles Cmdcerrar.Click
Me.Close()
End Sub
End Class
Public Class Frmgravedad
Dim masauno As Double
Dim masados As Double
Dim distancia As Double

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


System.EventArgs) Handles Cmdregrefuerza.Click
Me.Hide()
Frmmenu.Show()
End Sub

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


System.EventArgs) Handles Cmdcalcular.Click
masauno = Val(Txtmasauno.Text)
masados = Val(Txtmasados.Text)
distancia = Val(Txtdistancia.Text)

If ((masauno > 0) And (masados > 0) And (distancia > 0)) Then
Txtfuerza.Text = ((6.67384 / 100000000000) * (masauno) * (masados) /
((distancia) * (distancia)))
Else
MsgBox("INGRESE SOLO VALORES POSITIVOS", MsgBoxStyle.Information,
"SISTEMA DE INGENIERIA")
Txtmasauno.Text = ""
Txtmasados.Text = ""
Txtdistancia.Text = ""
Txtmasauno.Focus()
End If

End Sub

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


System.EventArgs) Handles Cmdlimpiafue.Click
Txtmasauno.Text = ""
Txtmasados.Text = ""
Txtdistancia.Text = ""
Txtfuerza.Text = ""
Txtmasauno.Focus()

End Sub
End Class
Public Class Frmtuberias

Dim caudal As Double


Dim diametro As Double
Dim longitud As Double

Dim perdida As Double

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


System.EventArgs) Handles Cmdregreper.Click
Me.Hide()
Frmmenu.Show()

End Sub

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


System.EventArgs) Handles Cmdcalcuper.Click
caudal = Val(Txtcaudal.Text)
diametro = Val(Txtdiametro.Text)
longitud = Val(Txtlongitud.Text)

If ((caudal > 0) And (diametro > 0) And (longitud > 0)) Then
perdida = ((9.84) * (1 / 10000) * ((caudal) ^ 1.756) * (longitud)) /
((diametro) ^ 4.789)
Txtperdida.Text = perdida
Else
MsgBox("INGRESE SOLO VALORES POSITIVOS", MsgBoxStyle.Information,
"SISTEMA DE INGENIERIA")
Txtcaudal.Text = ""
Txtdiametro.Text = ""
Txtlongitud.Text = ""
Txtcaudal.Focus()
End If

'perdida = ((9.84) * (1 / 10000) * ((caudal) ^ 1.756) * (longitud)) /


((diametro) ^ 4.789)

'Txtperdida.Text = perdida
End Sub

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


System.EventArgs) Handles Cmdlimpiatub.Click
Txtcaudal.Text = ""
Txtdiametro.Text = ""
Txtlongitud.Text = ""
Txtperdida.Text = ""

Txtcaudal.Focus()

End Sub
End Class

You might also like