Dobrý deň. Môžte prosím poradiť s týmto kódom?
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
Dim a As Decimal = CDec(TextBox1.Text)
Dim b As Decimal = CDec(TextBox2.Text)
Dim c As Decimal = b - a
TextBox3.Text = CDec(c)
Dim sum As Decimal = TextBox3.Text
For i As Integer = 0 To ListView1.Items.Count - 1
sum = sum + CDec(ListView1.Items(i).SubItems(2).Text)
Next
Label2.Text = sum
Dim s As Decimal = CDec(TextBox3.Text)
Dim d As Decimal = CDec(TextBox4.Text)
Dim f As Decimal = CDec(TextBox6.Text)
Dim g As Decimal = c * d + f
TextBox7.Text = CDec(g)
Dim sum As Decimal = TextBox7.Text
For i As Integer = 0 To ListView1.Items.Count - 1
sum = sum + CDec(ListView1.Items(i).SubItems(2).Text)
Next
Label7.Text = sum
Dim k As Decimal = CDec(TextBox7.Text)
Dim m As Decimal = CDec(TextBox5.Text)
Dim t As Decimal = m - k
TextBox8.Text = CDec(t)
Dim sum As Decimal = TextBox8.Text
For i As Integer = 0 To ListView1.Items.Count - 1
sum = sum + CDec(ListView1.Items(i).SubItems(2).Text)
Next
Label8.Text = sum
ListView1.Items.Add(New ListViewItem({TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, TextBox6.Text, TextBox7.Text, TextBox8.Text.ToString()}))
End Sub
Všetko mi počíta správne. Prvý výpočet mi sčíta celý stĺpec do Label2, ale druhý výpočet stlpca potrebujem dostať do Label7 a tretí výpočet stĺpca do Label8 a neviem ako nato. Ak vie niekto poradiť, alebo poopraviť vopred Ďakujem!!!
|