来源:百度文库 编辑:九乡新闻网 时间:2024/07/07 10:15:03
Private Sub Command1_Click() Dim t As Integer Dim f As Single Dim x As String t = Val(Text1.Text) Do While t<=0 MsgBox(“上网时间必须大于零!!!”) Text1.SetFocus t = Val(Text1.Text) Loop If t < 120 Then f = 0.06 * t Else f = 0.06 * t *0.85 EndIf x = Str$(f) + “元” label2.Caption = x End Sub