用doevents声明全局变量blSkip as boolean把这些写在窗体keypress里:blSkip =true循环里:doeventsif blSkip thenexit sub(或者exit do神马的)blSkip=falseend if这样可按任意键退出循环