Programa 7
Programa en Visual Studio 2010 que imprime el promedio en un form diferente al de los datos
Public Class Form1
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox2.TextChanged
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim Mate, Espa, Compu, Fisica, Quimica As Integer
Dim Mate2, Espa2, Compu2, Fisica2, Quimica2 As Integer
Dim Mate3, Espa3, Compu3, Fisica3, Quimica3 As Integer
Dim prom As Double
Dim prom2 As Double
Dim prom3 As Double
Mate = TextBox1.Text
Espa = TextBox2.Text
Compu = TextBox3.Text
Fisica = TextBox4.Text
Quimica = TextBox5.Text
prom = (Mate + Espa + Compu + Fisica + Quimica) / 5
Mate2 = TextBox6.Text
Espa2 = TextBox7.Text
Compu2 = TextBox8.Text
Fisica2 = TextBox9.Text
Quimica2 = TextBox10.Text
prom2 = (Mate2 + Espa2 + Compu2 + Fisica2 + Quimica2) / 5
Mate3 = TextBox11.Text
Espa3 = TextBox12.Text
Compu3 = TextBox13.Text
Fisica3 = TextBox14.Text
Quimica3 = TextBox15.Text
prom3 = (Mate3 + Espa3 + Compu3 + Fisica3 + Quimica3) / 5
Me.Visible = False
Form2.Show()
Form2.TextBox1.Text = prom
Form2.TextBox2.Text = prom2
Form2.TextBox3.Text = prom3
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox3.TextChanged
End Sub
Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox4.TextChanged
End Sub
Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox5.TextChanged
End Sub
Private Sub TextBox6_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox6.TextChanged
End Sub
Private Sub TextBox7_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox7.TextChanged
End Sub
Private Sub TextBox8_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox8.TextChanged
End Sub
Private Sub TextBox9_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox9.TextChanged
End Sub
Private Sub TextBox10_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox10.TextChanged
End Sub
Private Sub TextBox11_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox11.TextChanged
End Sub
Private Sub TextBox12_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox12.TextChanged
End Sub
Private Sub TextBox13_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox13.TextChanged
End Sub
Private Sub TextBox14_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox14.TextChanged
End Sub
Private Sub TextBox15_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox15.TextChanged
End Sub
End Class