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
Shafiqq Aziz
NA
54
12.2k
C# Countdown for 1 Year
Nov 15 2017 3:05 AM
Hi, is there any possibility to create a countdown for 1 year and disable login for windows form?
The countdown will not stop if the user logout the app or shutdown their PC.
int
OrigTime = 1800;
private
void
button1_Click(
object
sender, EventArgs e)
{
Timer timeX =
new
Timer();
timeX.Interval = 1800000;
timeX.Tick +=
new
EventHandler(timeX_Tick);
}
private void timeX_Tick(
object
sender, EventArgs e)
{
OrigTime--;
textBox1.Text = OrigTime/60 +
":"
+ ((OrigTime % 60) >= 10 ? (OrigTime % 60).ToString() :
"0"
+ OrigTime % 60);
}
The code above is triggered when user click a button and will stop automatically.
Reply
Answers (
2
)
XML Generation for import in TAlly software using C#
display data present struct to richtextbox