|
■No61015 (ER さん) に返信
button1をクリックして15秒間EnabledがFalseになります。
Timer1(Timerコントロール)をFormに貼り付け
Interval=100、
Enabled=False
に設定
Private ExecTime As Date
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
ExecTime = Date.Now.AddSeconds(15)
Button1.Enabled = False
End Sub
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
If Date.Now.Subtract(ExecTime).TotalSeconds >= 0 Then
Timer1.Enabled = False
'--- 処理
Button1.Enabled = True
End If
End Sub
|