Вы находитесь на странице: 1из 9

Prctica 7: Uso de MenuStrip

Tenemos que utilizar el control MenuStrip, lo arrastramos y soltamos en el Form1, aadiremos


un Label1 y un PictureBox, tal como se desarroll en clase, luego 6 Forms, 1 Modue1.
El Mdulo
------------------------------------------------------------------------------------------------------------------
Module Module1
Public ID As Single
Public V As Single
Public T As Single
Public n As Single
Public P As Single
Public Pc As Single
Public Tc As Single
Public A As Single
Public B As Single
Public C As Single
Public Pv As Single
Public H As Single
Public pH As Single
Public pOH As Single
Public sal As Single
Public acido As Single
Public Ka As Single
End Module
------------------------------------------------------------------------------------------------------------------
Public Class Form1
------------------------------------------------------------------------------------------------------------------
Private Sub GasesIdealesToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
GasesIdealesToolStripMenuItem.Click
Me.Hide()
form2.show()
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub VDWToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
VDWToolStripMenuItem.Click
Me.Hide()
Form3.Show()
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub RedlichKwongToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
RedlichKwongToolStripMenuItem.Click
Me.Hide()
Form4.Show()
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub EcAntoineToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
EcAntoineToolStripMenuItem.Click
Me.Hide()
Form5.Show()
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub SolucionesToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SolucionesToolStripMenuItem.Click
Me.Hide()
Form6.Show()
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub BufferToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BufferToolStripMenuItem.Click
Me.Hide()
Form7.Show()
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub WordToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
WordToolStripMenuItem.Click
ID = Shell("C:\Program Files (x86)\Microsoft
Office\Office15\winword.exe", 1)
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub ExcelToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ExcelToolStripMenuItem.Click
ID = Shell("C:\Program Files (x86)\Microsoft
Office\Office15\excel.exe", 1)
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub CartasToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
CartasToolStripMenuItem.Click
ID = Shell("c:\windows\system32\mspaint.exe", 1)
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub BuscaminasToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BuscaminasToolStripMenuItem.Click
ID = Shell("c:\windows\system32\calc.exe", 1)
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub SalirToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SalirToolStripMenuItem.Click
End
End Sub
End Class

------------------------------------------------------------------------------------------------------------------

Formulario 2

Public Class Form2


------------------------------------------------------------------------------------------------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
V = Val(TextBox1.Text)
T = Val(TextBox2.Text)
n = Val(TextBox3.Text)
P = n * 0.08205 * T / V
TextBox4.Text = Format(P, "##0.000")
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox1.Focus()
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button3.Click

Form1.Show()
Me.Hide()
End Sub
End Class

------------------------------------------------------------------------------------------------------------------
Formulario 3

Public Class Form3


------------------------------------------------------------------------------------------------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
V = Val(TextBox1.Text)
T = Val(TextBox2.Text)
Pc = Val(TextBox3.Text)
Tc = Val(TextBox4.Text)
A = 27 * 0.08205 ^ 2 * Tc ^ 2 / (64 * Pc)
B = 0.08205 * Tc / (8 * Pc)
P = 0.08205 * T / (V - B) - A / V ^ 2
TextBox5.Text = Format(P, "##0.000")
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox1.Focus()
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button3.Click

Form1.Show()
Me.Hide()
End Sub
End Class

------------------------------------------------------------------------------------------------------------------
Formulario 4

Public Class Form4


------------------------------------------------------------------------------------------------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
V = Val(TextBox1.Text)
T = Val(TextBox2.Text)
Pc = Val(TextBox3.Text)
Tc = Val(TextBox4.Text)
A = 0.42748 * 0.08205 ^ 2 * Tc ^ 2.5 / (Pc * T ^ 0.5)
B = 0.08664 * 0.08205 * Tc / Pc
P = 0.08205 * T / (V - B) - A / (T ^ 0.5 * V * (V + B))
TextBox5.Text = Format(P, "##0.000")
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox1.Focus()
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button3.Click

Form1.Show()
Me.Hide()
End Sub
End Class

------------------------------------------------------------------------------------------------------------------
Formulario 5

Public Class Form5


------------------------------------------------------------------------------------------------------------------

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


As System.EventArgs) Handles Button1.Click
T = Val(TextBox1.Text)
A = Val(TextBox2.Text)
B = Val(TextBox3.Text)
C = Val(TextBox4.Text)
Pv = 10 ^ (A - B / (C + T))
TextBox5.Text = Format(Pv, "##0.000")
End Sub
------------------------------------------------------------------------------------------------------------------

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


As System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox1.Focus()
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button3.Click

Form1.Show()
Me.Hide()
End Sub
End Class

------------------------------------------------------------------------------------------------------------------
Formulario 6

Public Class Form6


------------------------------------------------------------------------------------------------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
H = Val(TextBox1.Text)
pH = -Math.Log10(H)
pOH = 14 - pH
TextBox2.Text = Format(pH, "##0.000")
TextBox3.Text = Format(pOH, "##0.000")
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox1.Focus()
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button3.Click

Form1.Show()
Me.Hide()
End Sub
End Class

------------------------------------------------------------------------------------------------------------------
Formulario 7

Public Class Form7


------------------------------------------------------------------------------------------------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
sal = Val(TextBox1.Text)
acido = Val(TextBox2.Text)
Ka = Val(TextBox3.Text)
pH = (-Math.Log(Ka) + Math.Log(sal / acido)) / Math.Log(10)
pOH = 14 - pH
TextBox4.Text = Format(pH, "##0.000")
TextBox5.Text = Format(pOH, "##0.000")
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox1.Focus()
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button3.Click

Form1.Show()
Me.Hide()
End Sub
End Class

------------------------------------------------------------------------------------------------------------------

Вам также может понравиться