a(i) = Mid(s, i, 1)改为a(i) = Val(Mid(s, i, 1))原因是Mid函数的返回值是字符串,而a数组是整数,所以提示类型不匹配把Mid函数的返回值转为数字就行了private sub command1_click() dim a as single dim b as single dim c as single a=int(text1.text)b=int(text2.text)c = a + b text3.text = cend sub private sub command2_click() text1.text = " " text2.text = " " text3.text = " " end subprivate sub command1_click() dim a as single dim b as single dim c as single a=int(text1.text)b=int(text2.text)c = a + b text3.text = cend sub private sub command2_click() text1.text = " " text2.text = " " text3.text = " " end sub