使用静态变量或全局变量可达到此种效果,以静态变量为例,参考代码:
Option ExplicitPrivate Sub Command1_Click() Static i As Integer i = i + 2 Print String$(i, "V")End SubPrivate Sub Form_Load() AutoRedraw = TrueEnd Sub
演示动画: