r = Val(Text2.Text) If r > 0 Then rs = rs + 1 / r List1.AddItem Str(r) Else MsgBox "无效电阻,重新输入" End If