StdFuncクラス WaitSecメソッド
秒で指定した時間停止してWindowsに処理を明け渡します。
指定した秒間処理を中断します。停止ボタンが押された時点でStdクラスのStopFlagがTrueになりますが、常にこれを監視し、Trueになった時点で処理を抜けます。
停止時間中は、キー入力等を受付可能にする為、Windowsに処理を明け渡します。よってフリーズ状態になる事が有りません。
使用法
Dim instance As StdFunc = New StdFunc()
Dim value As Integer
instance.WaitSec(value)
使用例
'StdFuncクラス WaitSecメソッド
Imports System.Windows.Forms
Public Class AddIn
Private std As Std
Private stdf As StdFunc
Public Sub New()
std = New Std()
stdf = New StdFunc()
End Sub
Public Sub AddIn_Start()
MessageBox.Show("3秒停止します")
stdf.WaitSec(3)
If std.StopFlag Then
MessageBox.Show("中断しました")
Else
MessageBox.Show("3秒経過しました")
End If
End Sub
End Class