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