上机程序设计题题解
加法器
Private Sub Form_Load()
= 1
= 1
= 1
=True
End Sub
Private mand1_Click()
= Str(Val() + Val())
End Sub
Private mand2_Click()
= ""
= ""
= ""
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then
KeyAscii = 0
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then
KeyAscii = 0
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then
KeyAscii = 0
End If
End Sub
健康称
Private Sub Form_Load()
= "健康称"
= 1
= 1
= 3
= 3
End Sub
Private mand1_Click()
Dim sg As Integer, tz As Integer, bz As Integer
sg = Val()
tz = Val ()
bz = sg - 105
If tz/ bz >= Then
= "偏胖,注意节俭!"
ElseIf tz / bz <= Then
= "偏瘦,增加营养!"
Else
= "正常。继续保持!"
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0:
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0:
End S
vb上机程序设计题题解 来自淘豆网www.taodocs.com转载请标明出处.