il programma per intero, ora vi mando l'altra parte..
codice:
Public Class Form1
Dim a1, b1, c1, d1, e1, f1, g1, h1, i1, l1, m1, n1, o1, p1, q1, a2, b2, c2, d2, e2, f2, g2, h2, i2, l2, m2, n2, o2, p2, q2 As Integer
Dim risultato As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' assegno valore ad a1; b1; ...; q1
a1 = Val(TextBox1.Text)
b1 = Val(TextBox2.Text)
c1 = Val(TextBox3.Text)
d1 = Val(TextBox4.Text)
e1 = Val(TextBox5.Text)
f1 = Val(TextBox6.Text)
g1 = Val(TextBox7.Text)
h1 = Val(TextBox8.Text)
i1 = Val(TextBox9.Text)
l1 = Val(TextBox10.Text)
m1 = Val(TextBox11.Text)
n1 = Val(TextBox12.Text)
o1 = Val(TextBox13.Text)
p1 = Val(TextBox14.Text)
q1 = Val(TextBox15.Text)
' calcolo valori a2; b2; ...; q2
TextBox16.Text = "€ " & a1 * 0.01
TextBox17.Text = "€ " & b1 * 0.02
TextBox18.Text = "€ " & c1 * 0.05
TextBox19.Text = "€ " & d1 * 0.1
TextBox20.Text = "€ " & e1 * 0.2
TextBox21.Text = "€ " & f1 * 0.5
TextBox22.Text = "€ " & g1
TextBox23.Text = "€ " & h1 * 2
TextBox24.Text = "€ " & i1 * 5
TextBox25.Text = "€ " & l1 * 10
TextBox26.Text = "€ " & m1 * 20
TextBox27.Text = "€ " & n1 * 50
TextBox28.Text = "€ " & o1 * 100
TextBox29.Text = "€ " & p1 * 200
TextBox30.Text = "€ " & q1 * 500
' assegno valori a2; b2; ...; q2
a2 = a1 * 0.1
b2 = b1 * 0.2
c2 = c1 * 0.5
d2 = d1 * 0.1
e2 = e1 * 0.2
f2 = f1 * 0.5
g2 = g1
h2 = h1 * 2
i2 =i1 * 5
l2 =l1 * 10
m2 = m1 * 20
n2 = n1 * 50
o2 = o1 * 100
p2 = p1 * 200
q2 = q1 * 500
' calcolo il totale dei soldi e del denaro
TextBox31.Text = "€ " & Val(a2 + b2 + c2 + d2 + e2 + f2 + g2 + h2 + i2 + l2 + m2 + n2 + o2 + p2 + q2)
TextBox32.Text = a1 + b1 + c1 + d1 + e1 + f1 + g1 + h1 + i1 + l1 + m1 + n1 + o1 + p1 + q1
' calcoli relativi alla carta:
TextBox33.Text = "€ " & i2 + l2 + m2 + n2 + o2 + p2 + q2 TextBox34.Text = i1 + l1 + m1 + n1 + o1 + p1 + q1
' calcoli relativi alle monete
TextBox35.Text = "€ " & a2 + b2 + c2 + d2 + e2 + f2 + g2 + h2
TextBox36.Text = a1 + b1 + c1 + d1 + e1 + f1 + g1 + h1
End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox1.Text = Nothing
TextBox2.Text = Nothing
TextBox3.Text = Nothing
TextBox4.Text = Nothing
TextBox5.Text = Nothing
TextBox6.Text = Nothing
TextBox7.Text = Nothing
TextBox8.Text = Nothing
TextBox9.Text = Nothing
TextBox10.Text = Nothing
TextBox11.Text = Nothing
TextBox12.Text = Nothing
TextBox13.Text = Nothing
TextBox14.Text = Nothing
TextBox15.Text = Nothing
TextBox16.Text = Nothing
TextBox17.Text = Nothing
TextBox18.Text = Nothing
TextBox19.Text = Nothing
TextBox20.Text = Nothing
TextBox21.Text = Nothing
TextBox22.Text = Nothing
TextBox23.Text = Nothing
TextBox24.Text = Nothing
TextBox25.Text = Nothing
TextBox26.Text = Nothing
TextBox27.Text = Nothing
TextBox28.Text = Nothing
TextBox29.Text = Nothing
TextBox30.Text = Nothing
TextBox31.Text = Nothing
TextBox32.Text = Nothing
TextBox33.Text = Nothing
TextBox34.Text = Nothing
TextBox35.Text = Nothing
TextBox36.Text = Nothing
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
risultato = "Resoconto soldi "
If SaveFileDialog1.ShowDialog = DialogResult.OK Then My.Computer.FileSystem.WriteAllText(SaveFileDialog1.FileName, risultato, True) End If End Sub End Class