 |
|
สอบถามหน่อยครับ พอดีต้องการทำนาฬิกานับเวลาถอยหลังหน้าเว็บอ่ะครับ |
|
 |
|
|
 |
 |
|
ใช้ Timer ก็ได้แล้วครับง่าย ๆ
Code (VB.NET)
Private Sub Timer1_Tick() Handles Timer1.Tick
If timeLeft > 0 Then
' Display the new time left
' by updating the Time Left label.
timeLeft -= 1
timeLabel.Text = timeLeft & " seconds"
Else
' If the user ran out of time, stop the timer, show
' a MessageBox, and fill in the answers.
Timer1.Stop()
timeLabel.Text = "Time's up!"
MessageBox.Show("You didn't finish in time.", "Sorry!")
sum.Value = addend1 + addend2
startButton.Enabled = True
End If
End Sub
Code (C#)
private void timer1_Tick(object sender, EventArgs e)
{
if (timeLeft > 0)
{
// Display the new time left
// by updating the Time Left label.
timeLeft = timeLeft - 1;
timeLabel.Text = timeLeft + " seconds";
}
else
{
// If the user ran out of time, stop the timer, show
// a MessageBox, and fill in the answers.
timer1.Stop();
timeLabel.Text = "Time's up!";
MessageBox.Show("You didn't finish in time.", "Sorry!");
sum.Value = addend1 + addend2;
startButton.Enabled = true;
}
}
|
 |
 |
 |
 |
Date :
2016-01-09 14:40:15 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
สอบถามเพื่มครับ พอดีเอาไปใช้กับ Web
sum.Value = addend1 + addend2; คือรับข้อมูลมากตัวไหนอ่ะครับ
|
ประวัติการแก้ไข 2016-01-13 14:15:11 2016-01-13 16:22:51
 |
 |
 |
 |
Date :
2016-01-13 14:09:58 |
By :
toey1 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|