intero2

esercitazione didattica per gestione interi inseriti da tastiera
con label e textbox

Private Sub CommandButton1_Click()
Rem gestione interi introdotti con label e textbox
Rem somma e prodotto di due interi
Dim a, b, somma, prodotto As Integer
Dim c, d, somma1, prodotto1 As Integer
Dim e, f, g, h As Integer
Dim somma2, somma3, prodotto2, prodotto3 As Integer
a = Val(TextBox1)
b = Val(TextBox2
)
somma = a + b
prodotto = a * b
c = Val(TextBox3.Text)
d = Val(TextBox4.Text)

somma1 = c + d
prodotto1 = c * d
e = Val(Label2.Caption)
f = Val(Label3.Caption)

somma2 = e + f
prodotto2 = e * f
g = Label4.Caption
h = Label5.Caption

somma3 = g + h
prodotto3 = g * h
ListBox1.AddItem (somma)
ListBox1.AddItem (prodotto)
ListBox1.AddItem ("--------")
ListBox1.AddItem (somma1)
ListBox1.AddItem (prodotto1)
ListBox1.AddItem ("----------")
ListBox1.AddItem (somma2)
ListBox1.AddItem (prodotto2)
ListBox1.AddItem ("-----------")
ListBox1.AddItem (somma3)
ListBox1.AddItem (prodotto3)
ListBox1.AddItem ("-----------")
TextBox1.SetFocus
End Sub

per attivazione vedi intero2.ppt

altro esempio intero3.htm