3 textbox, 2 label, 1 button
Private Sub Command1_Click()
Dim a, b As Single
Dim c, d As Integer
'Dalam satu declare leh ada dua nama je, kalo lebih buat declaration baru.
a = (Text2.Text) 'length 1
b = (Text3.Text) 'length 2
d = a + b 'total length
c = Text1.Text * Text2.Text
Label2.Caption = (c / d) 'reaction b
Label1.Caption = (Text1.Text) - (Label2.Caption)
End Sub
---
Data yg boleh dimasukkan dlm kotak input cuma single (sbb korg declare single)
kalau data lain kuar error.
No comments:
Post a Comment