我知道了,在timer事件里计算执行了次不能用dim定义变量,只能用Static定义
[code=text]
Private Sub Timer1_Timer()
static k as integer
if text1.text<>"" then
print text1.text
else
k=k+1
if k=10 then
timer1.enable=flase
end if
end if
End Sub
[/code
可能是我没表达清楚,希望能对别人有用。
写一个for循环,
for i =1 to 10
if text<>""then
print text
else
if i=10 then
msgbox("10秒内未出现数字!")
end if
end if
Next i
现在在学C#语言,有些语句可能不正确,你先试试,有问题@我,我明天在电脑上给你写。