这段代码放到单击事件中 count在窗体级上定义与赋值,单击事件中不赋值,只做累加 me.hide改成unload me
你的变量count是local变量,每次调用这个sub时它就被初始化为0。 可以用全局变量 e.g, pubic g_intCount as integerprivate sub test() if condition=true then g_intCount = g_intCount +1 end if if g_intCount = 3 then 'do some thing here end if end sub
count在窗体级上定义与赋值,单击事件中不赋值,只做累加
me.hide改成unload me
可以用全局变量
e.g, pubic g_intCount as integerprivate sub test()
if condition=true then
g_intCount = g_intCount +1
end if if g_intCount = 3 then
'do some thing here end if
end sub