0% found this document useful (0 votes)
44 views

Public Class Form1

This document contains code for a click event handler that: 1. Sets labels and textboxes based on selected items in two listboxes. 2. Performs calculations and sets labels based on values of textboxes and previous labels. 3. Performs additional calculations involving exponents, sums, and setting additional labels. 4. Makes several groups visible, sets final label values, and performs a multi-term calculation.

Uploaded by

briguit
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)
44 views

Public Class Form1

This document contains code for a click event handler that: 1. Sets labels and textboxes based on selected items in two listboxes. 2. Performs calculations and sets labels based on values of textboxes and previous labels. 3. Performs additional calculations involving exponents, sums, and setting additional labels. 4. Makes several groups visible, sets final label values, and performs a multi-term calculation.

Uploaded by

briguit
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/ 3

Public Class Form1

Private Sub button4_Click(sender As Object, e As EventArgs) Handles


button4.Click

If listBox1.SelectedItem = "CH4" Then


textBox1.Text = "CH4"
label12.Text = 1
label13.Text = "CH4"
label16.Text = 2
label19.Text = 1
label22.Text = 2
label12.Visible = True
label13.Visible = True
label16.Visible = True
label19.Visible = True
label23.Visible = True
label17.Visible = True
label20.Visible = True
label21.Visible = True
label22.Visible = True
label14.Visible = True
label18.Visible = True
Label81.Text = "CH4"

Label72.Text = "CH4"

End If

If listBox2.SelectedItem = "C2H6" Then


textBox2.Text = "C2H6"
label27.Text = 1
label28.Text = "C2H6"
label29.Text = 3.5
label30.Text = 2
label32.Text = 3
label27.Visible = True
label28.Visible = True
label29.Visible = True
label30.Visible = True
label32.Visible = True
label15.Visible = True
label24.Visible = True
label31.Visible = True
label25.Visible = True
label33.Visible = True
label26.Visible = True
Label82.Text = "C2H6"

Label71.Text = "C2H6"

End If

Label66.Text = (Val(textBox4.Text) * Val(textBox7.Text)) / 100


Label67.Text = (Val(textBox3.Text) * Val(textBox7.Text)) / 100

Label65.Text = (Val(textBox5.Text) * Val(textBox7.Text)) / 100


Label61.Text = Val(Label66.Text) * 30
Label62.Text = Val(Label67.Text) * 16

Label64.Text = (Val(label16.Text) * Val(Label67.Text) + Val(label29.Text) *


Val(Label66.Text)) * (100 + Val(textBox6.Text)) / 100

Label63.Text = Val(Label64.Text) * (0.79 / 0.21)


Dim substring2 As String = Microsoft.VisualBasic.Left(Label63.Text, 7)
Label63.Text = substring2
Label56.Text = Val(Label67.Text) + Val(Label66.Text) + Val(Label65.Text) +
Val(Label64.Text) + Val(Label63.Text)

Label60.Text = Val(Label65.Text) * 28
Label59.Text = Val(Label64.Text) * 32
Label58.Text = (Val(Label63.Text) * 28)
Dim substring3 As String = Microsoft.VisualBasic.Left(Label58.Text, 8)
Label58.Text = substring3
Label55.Text = Val(Label62.Text) + Val(Label61.Text) + Val(Label60.Text) +
Val(Label59.Text) + Val(Label58.Text)
Dim substring1 As String = Microsoft.VisualBasic.Left(Label55.Text, 8)
Label55.Text = substring1
Dim substring12 As String = Microsoft.VisualBasic.Left(Label38.Text, 7)
Label38.Text = substring12

Label47.Text = Val(label19.Text) * Val(Label67.Text) + Val(label30.Text) *


Val(Label66.Text)
Label43.Text = Val(Label47.Text) * 44
Label46.Text = Val(label22.Text) * Val(Label67.Text) + Val(label32.Text) *
Val(Label66.Text)
Label42.Text = Val(Label46.Text) * 18
Label45.Text = Val(Label64.Text) * Val(textBox6.Text) / (100 +
Val(textBox6.Text))
Label41.Text = Val(Label45.Text) * 32
Label44.Text = Val(Label63.Text) + Val(Label65.Text)
Label40.Text = Val(Label44.Text) * 28
Label38.Text = Val(Label47.Text) + Val(Label46.Text) + Val(Label45.Text) +
Val(Label44.Text)
Label37.Text = Val(Label43.Text) + Val(Label42.Text) + Val(Label41.Text) +
Val(Label40.Text)
Label56.Text = Val(Label67.Text) + Val(Label66.Text) + Val(Label65.Text) +
Val(Label64.Text) + Val(Label63.Text)
Dim substring As String = Microsoft.VisualBasic.Left(Label56.Text, 6)
Label56.Text = substring
Dim substring4 As String = Microsoft.VisualBasic.Left(Label113.Text, 6)
Label113.Text = substring4
Dim substring5 As String = Microsoft.VisualBasic.Left(Label116.Text, 6)
Label116.Text = substring5
Dim substring6 As String = Microsoft.VisualBasic.Left(label32.Text, 6)
label32.Text = substring6
Dim substring7 As String = Microsoft.VisualBasic.Left(Label121.Text, 6)
Label121.Text = substring7
Dim substring8 As String = Microsoft.VisualBasic.Left(label24.Text, 6)
label24.Text = substring8
Dim substring9 As String = Microsoft.VisualBasic.Left(label27.Text, 8)
label27.Text = substring9
Dim substring10 As String = Microsoft.VisualBasic.Left(label31.Text, 6)
label31.Text = substring10

Label88.Text = -212798 * Val(Label67.Text)


Label89.Text = -372820 * Val(Label66.Text)
Label90.Text = 6.214 * Val(Label47.Text)
Label91.Text = 7.256 * Val(Label46.Text)
Label92.Text = 6.148 * Val(Label45.Text)
Label93.Text = 6.524 * Val(Label44.Text)
Label95.Text = 10.396 * Val(Label47.Text) * 0.001
Label96.Text = 2.298 * Val(Label46.Text) * 0.001
Label97.Text = 3.102 * Val(Label45.Text) * 0.001
Label98.Text = 1.25 * Val(Label44.Text) * 0.001
Label100.Text = -3.545 * Val(Label47.Text) * 0.000001
Label101.Text = 0.283 * Val(Label46.Text) * 0.000001
Label102.Text = -0.923 * Val(Label45.Text) * 0.000001
Label103.Text = -0.001 * Val(Label44.Text) * 0.000001
Label94.Text = Val(Label90.Text) + Val(Label91.Text) + Val(Label92.Text) +
Val(Label93.Text)
Label99.Text = Val(Label95.Text) + Val(Label98.Text) + Val(Label96.Text) +
Val(Label97.Text)
Label104.Text = Val(Label100.Text) + Val(Label101.Text) + Val(Label102.Text)
+ Val(Label103.Text)
Label130.Text = Val(Label88.Text) + Val(Label89.Text)
Label131.Text = Val(Label88.Text) + Val(Label89.Text)
Label127.Text = Val(TextBox8.Text) ^ 3
Label121.Text = Val(TextBox8.Text) ^ 2
Label116.Text = Val(TextBox8.Text)
Label113.Text = Val(Label94.Text)
Label132.Text = Val(Label99.Text) / 2
Label124.Text = Val(Label104.Text) / 3

GroupBox4.Visible = True
GroupBox3.Visible = True
GroupBox5.Visible = True
GroupBox6.Visible = True
GroupBox7.Visible = True

Label134.Text = Val(Label124.Text)
Dim substring11 As String = Microsoft.VisualBasic.Left(Label110.Text, 7)
Label110.Text = substring11
Label137.Text = Val(Label132.Text)
Label140.Text = Val(Label113.Text)
Label143.Text = Val(Label113.Text) * -Val(Label116.Text) +
Val(Label132.Text) * -Val(Label121.Text) + Val(Label124.Text) * -Val(Label127.Text)
+ Val(Label131.Text)

You might also like