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
sudha kovid kolli
NA
3
2.5k
Timers
Oct 11 2010 3:41 PM
sir,
I have a query here, I want the start and stop to be the same button and I want to display the time that tells me how many seconds it took me to start and stop. I am unable to do that seeking your help. here is my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Timers4
{
public partial class TimingGameForm : Form
{
public TimingGameForm()
{
InitializeComponent();
}
private int elapsed = 0;
private bool started = false;
private void Start_Click(object sender, EventArgs e)
{
if (started == true)
{
timer1.Enabled = true;
Estimatelbl.Text = "Running....";
}
else if (started == false)
{
timer1.Enabled = false;
Timelbl.Text = "that took" + elapsed + "seconds";
}
}
private void timer_Tick(object sender, EventArgs e)
{
elapsed += 1;
}
}
}
Reply
Answers (
2
)
Filling a template with information.
Text to speech