2016-09-02 9 views
0

(分秒)タイマーでtimerformatを表示することができます。私のタイマーが上昇し、60秒がある場合、分があるはず、と秒をゼロにする必要があります。今では単に秒でカウントします。私はあなたの助けを願っています。あなたがこれを行うにするTimeSpanを使用することができますは、どのように私は、タイマーを持っていると私は分と秒を表示するWPF vb.net

Private timer As DispatcherTimer 
Private CountUp As Integer 

Public Sub DispatcherTimerSetup() 

    timer = New DispatcherTimer() 
    timer.Interval = New TimeSpan(0, 0, 1) 
    AddHandler timer.Tick, AddressOf timer_Tick 
    timer.Start() 

End Sub 

Private Sub timer_Tick(sender As Object, e As Object) 

    CountUp += 1 
    txblCountdown.Text = CountUp.ToString("00\:00") 
    'timeformat 

End Sub 

よろしく、 ポリーナ

答えて

0

Private Sub timer_Tick(sender As Object, e As Object) 

    CountUp += 1 
    Dim counter As TimeSpan 
    counter = TimeSpan.FromSeconds(CountUp) 
    txblCountdown.Text = counter.ToString("mm\:ss") 

End Sub 
+0

はありがとうございました!!!! –

関連する問題