tinh tong chan le
Private Sub cmdtinh_Click()
Dim x, y, i As Integer
Dim k, l As String
x = Val(txt1)
y = Val(txt2)
For i = x To y
If (i Mod 2 = 0) Then
k = Str(i) & " "
txtsc = txtsc & k
txttc = Str(Val(txttc) + Val(k))
Else
l = Str(i) & " "
txtsl = txtsl & l
txttl = Str(Val(txttl) + Val(l))
End If
Next i
txttcl = Str(Val(txttc) + Val(txttl))
End Sub
Private Sub cmdtl_Click()
txt1 = ""
txt2 = ""
txtsc = ""
txtsl = ""
txttc = ""
txttl = ""
txttcl = ""
txt1.SetFocus
End Sub
Private Sub cmdthoat_Click()
Dim x As String
x = MsgBox("Ban muon thoat?", vbOKCancel + vbQuestion + vbDefaultButton1, "Thong bao")
If x = vbOK Then
End
End If
End Sub
Bạn đang đọc truyện trên: AzTruyen.Top