level 8
Private Sub Command1_Click() Dim n As Integer n = Val(Text1.Text) If n < 100 Or n > 999 Or Len(Text1.Text) <> 3 Then msg = "请输入一个三位数字(100-999)!" Title = "错误" MsgBox msg, 0, Title End If If n >= 100 And n <= 999 And Len(Text1.Text) = 3 Then Label3.Caption = CStr(Val(Left(Text1.Text, 1)) + Val(Mid(Text1.Text, 2, 1)) + Val(Right(Text1.Text, 1))) End If End Sub
2007年04月29日 10点04分