0% found this document useful (0 votes)
46 views5 pages

Examen Progra

The document defines four forms (Form1, Form2, Form3, Form4) with different controls and calculations. Form1 contains radio buttons to select the other forms. Form2 calculates volume given temperature, moles, and pressure. Form3 calculates pressure given temperature, moles, and volume. Form4 performs basic math operations on two input values.
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)
46 views5 pages

Examen Progra

The document defines four forms (Form1, Form2, Form3, Form4) with different controls and calculations. Form1 contains radio buttons to select the other forms. Form2 calculates volume given temperature, moles, and pressure. Form3 calculates pressure given temperature, moles, and volume. Form4 performs basic math operations on two input values.
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/ 5

Module Module1

Public id As Single
Public N As Single
Public P As Single
Public T As Single
Public V As Single
Public A As Single
Public B As Single
Public C As Single
End Module

Public Class Form1


Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
RadioButton1.Checked = False
RadioButton2.Checked = False
RadioButton3.Checked = False
RadioButton4.Checked = False
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

End
End Sub
Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles
RadioButton1.CheckedChanged
Me.Hide()
Form2.Show()
End Sub
Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles
RadioButton2.CheckedChanged
Me.Hide()
Form3.Show()
End Sub
Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles
RadioButton3.CheckedChanged
Me.Hide()
Form4.Show()
End Sub
Private Sub RadioButton4_CheckedChanged(sender As Object, e As EventArgs) Handles
RadioButton4.CheckedChanged
id = Shell("C:\Program Files (x86)\Microsoft Office\Office15\XLICONS.exe", 1)
End Sub
End Class

Public Class Form2

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click


N = Val(TextBox1.Text)
T = Val(TextBox2.Text)
P = Val(TextBox3.Text)
V = (0.08205 * T * N) / P
TextBox4.Text = V
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox1.Focus()
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Me.Hide()
Form1.Show()
End Sub
End Class

Public Class Form3

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click


N = Val(TextBox1.Text)
T = Val(TextBox2.Text)
V = Val(TextBox3.Text)
P = (0.08205 * T * N) / V
TextBox4.Text = P
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox1.Focus()
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Me.Hide()
Form1.Show()
End Sub
End Class

Public Class Form4


Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
A = Val(TextBox1.Text)
B = Val(TextBox2.Text)
C=A+B
TextBox3.Text = C

End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
A = Val(TextBox1.Text)
B = Val(TextBox2.Text)
C=A-B
TextBox3.Text = C
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
A = Val(TextBox1.Text)
B = Val(TextBox2.Text)
C=A*B
TextBox3.Text = C
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
A = Val(TextBox1.Text)
B = Val(TextBox2.Text)
C=A/B
TextBox3.Text = C
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox1.Focus()
End Sub
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
Me.Hide()
Form1.Show()
End Sub
End Class

You might also like