私はカウンターがあるテスト紙を作っています。次のフォームで同じカウントダウンタイマーを続ける方法は?
Public Class Form3
Inherits System.Windows.Forms.Form
Private alarmTime As Date
Private Sub Form3_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.alarmTime = Date.Now.AddMinutes(60)
Me.Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Timer1.Tick
If alarmTime < Date.Now Then
Me.Timer1.Stop()
MessageBox.Show("Time's up.")
Else
Dim remainingTime As TimeSpan = Me.alarmTime.Subtract(Date.Now)
Me.Label6.Text = String.Format("{0}:{1:d2}:{2:d2}", _
remainingTime.Hours, _
remainingTime.Minutes, _
remainingTime.Seconds)
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim frmDialogue As New Form8
frmDialogue.ShowDialog()
End Sub
@teena gupta - これは、あなたが望むものを達成するのに役立ちましたか? – aligray