特定の条件に当てはまる場合、ステータスバーに30秒間メッセージを表示しようとしています。何らかの理由で、タイマーが有効になっているときにTimer.Tick
イベントが実行されていないため、私はTick
サブに何かが見つからないと確信していますが、それを把握することはできません。VB.Net Timer.Tick Not Firing
ここに私のコードです:
Dim StatusSecondsPassed As Integer = 0
Dim StatusTimer As New Timer()
Dim StatusTextField As New ToolStripStatusLabel
Public Function WriteStatus(SS As String)
If StatusTimer.Enabled = True Then
StatusTimer.Enabled = False
End If
StatusSecondsPassed = 0
StatusTimer.Interval = 1 * 1000
StatusTimer.Enabled = True
Return SS
End Function
Public Sub StatusTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim cMain_Form As Main_Form
StatusSecondsPassed += 1
If StatusSecondsPassed = 30 Then
cMain_Form.StatusTextBox.Text = ""
End If
End Sub
任意のアイデア?私はダニサブの端にHandles
を入れてみましたが、私はHandles StatusTimer.Tick
ビット不公平を... – SilverShotBee
-1 downvotesについてwhinesがコメントを残す:AddHandlerの句を使用すると、実行してイベントリスナーを削除することができます。質問をdownvotingすることについて「不公平」はありません。誰もコメントを残す義務はありません。 –