snasui.com ยินดีต้อนรับ ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ ระบุ Version ของ Excel
Public Class Form1
Private countDownTime As TimeSpan
Private countDownWatch As Stopwatch
Private Sub btn_start_Click(sender As Object, e As EventArgs) Handles btn_start.Click, bttnStartStop.Click
countDownTime = TimeSpan.FromMinutes(TextBox1.Text)
countDownWatch = Stopwatch.StartNew()
Timer1.Start()
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim timeRemaining = countDownTime - countDownWatch.Elapsed
If timeRemaining < TimeSpan.Zero Then
timeRemaining = TimeSpan.Zero
End If
hr_label.Text = timeRemaining.ToString("hh\:mm\:ss")
If timeRemaining = TimeSpan.Zero Then
Timer1.Stop()
MessageBox.Show("หมดเวลาแล้ว")
End If
End Sub
Private Sub btn_countinue_Click(sender As Object, e As EventArgs) Handles btn_countinue.Click, bttnReset.Click
Timer1.Start()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Timer1.Stop()
End Sub
End class
r เวลากดหยุดแล้ว พอจะกดต่อเนื่องแล้วค่าไม่เหมือนตอนกดหยุด
You do not have the required permissions to view the files attached to this post.