という感じでどんどん実行回数が増えていってしまいます。
ネットで以前拾ったフリーの物をいじっていて、以下のようになっているのですがどうやったら1分毎に1回だけ実行させるように変えられますか?
Sub aaa
AddHandler Timer.Tick, AddressOf Check
Timer.Interval = 60 * 1000
Timer.Enabled = True
End Sub
Sub Check()
AddHandler BackGround.DoWork, AddressOf _Check
AddHandler BackGround.RunWorkerCompleted, AddressOf Balloon_Show
If BackGround.IsBusy Then
Return
End If
BackGround.RunWorkerAsync()
End Sub
Sub _Check()
MsgBox("チェック")
End Sub
こう、かな。
Sub aaa AddHandler Timer.Tick, AddressOf Check Timer.Interval = 60 * 1000 Timer.Enabled = True ' BackGround への登録は一回だけ AddHandler BackGround.DoWork, AddressOf _Check AddHandler BackGround.RunWorkerCompleted, AddressOf Balloon_Show End Sub Sub Check() If BackGround.IsBusy Then Return End If BackGround.RunWorkerAsync() End Sub Sub _Check() MsgBox("チェック") End Sub