Private Sub Command1_Click()
Dim x As Double
Dim y As Single
x = Val(Text1.Text)
y = Val(Text2.Text)
Select Case x
Case Is <= 500
y = x * 0.05
Case Is <= 2000
y = x * 0.1
Case Is <= 5000
y = x * 0.15
Case Is <= 20000
y = x * 0.2
Case Is <= 40000
y = x * 0.25
Case Is <= 60000
y = x * 0.3
Case Is <= 80000
y = x * 0.35
Case Is <= 100000
y = x * 0.4
Case Else
y = x * 0.45
End Select
Text2.Text = Format(y, "0")
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Dim x As Double
Dim y As Single
x = Val(Text1.Text)
y = Val(Text2.Text)
Select Case x
Case Is <= 500
y = x * 0.05
Case Is <= 2000
y = x * 0.1
Case Is <= 5000
y = x * 0.15
Case Is <= 20000
y = x * 0.2
Case Is <= 40000
y = x * 0.25
Case Is <= 60000
y = x * 0.3
Case Is <= 80000
y = x * 0.35
Case Is <= 100000
y = x * 0.4
Case Else
y = x * 0.45
End Select
Text2.Text = Format(y, "0")
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
End Sub
看着老师演示了一遍自己可以模仿个大概,但某些方面还要自己去查书,自己去搞明白