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
praveen kumar
NA
36
21.4k
Threads Using In WinApps
Nov 28 2015 1:49 AM
Hi good afternoon ,
i created one Form1 inside Form1 create one button1 when i click button new Form2 will open
and it will terminate after 3 minutes i am using timer control and set time working good
i took one label in Form2 and add Decrese Time 02:59 Min and seconds format ,what ever i wrote code working good,
but I want to time interval put threads process how we add to thread this code
if any body knows please replay me
Thanks in Advance.
//Form1 Button Code
private void button1_Click(object sender, EventArgs e)
{
Form2 fr = new Form2();
fr.ShowDialog();
}
//Form2 Code
private void Form4_Load(object sender, EventArgs e)
{
timer1.Interval = 1000;
timer1.Tick += new EventHandler(timer1_Tick);
timer1.Enabled = true;
timer1.Start();
}
void timer1_Tick(object sender, EventArgs e)
{
seconds--;
label1.Text = ((seconds / 60).ToString().Length == 2 ? (seconds / 60).ToString() : "0" + (seconds / 60).ToString()) + ":" + ((seconds % 60).ToString().Length == 2 ? (seconds % 60).ToString() : "0" + (seconds % 60).ToString());
if (seconds == 0)
{
this.close();
}
}
Reply
Answers (
1
)
merge cells in windows forms application
Timer add To Thread