TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Quang Dinh Luong
NA
76
18.8k
StopWatch? iN C#? I encountered a problem!
Oct 22 2015 11:56 PM
As the subject, I am making a StopWatch. You know, to learn Timer!
Ok, here's my code:
(ms = 1, hour, min, second = 0)
private void timerDisplay_Tick(object sender, EventArgs e)
{
ms++;
if
(ms ==
10
)
{
sec++;
ms =
1
;
}
txtMilisecond.Text =
"."
+ ms;
if
(sec ==
60
)
{
min++;
sec =
0
;
}
txtSecond.Text =
""
+ sec;
if
(min ==
60
)
{
hour++;
min =
0
;
}
txtMinute.Text =
""
+ min;
txtHour.Text =
""
+ hour;
}
When I run this, it gets faster and faster than an usal watch!
Anyone knows the problem?
Thanks,
Reply
Answers (
2
)
Instagram Profile Search By Keyword
Problem for solution