how to add the voice of clock in the stopwatch
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Asad AliPosted Apr 13, 2016, 2:40 PM
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Media;
namespace WindowsFormsApplication9
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int a, b, c, d, s=0;
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Start();
}
private void button2_Click(object sender, EventArgs e)
{
timer1.Stop();
}
private void button3_Click(object sender, EventArgs e)
{
}
private void timer1_Tick(object sender, EventArgs e)
{
System.Media.SystemSounds.Beep.Play();
if (s == 0)
{
label3.Visible = false;
s = 1;
}
else {
label3.Visible = true;
s = 0;
}
a++;
label1.Text = a.ToString();
if (a >= 60)
{
a = 0;
b++;
label2.Text = b.ToString();
}
if (b >= 60)
{
b = 0;
c++;
label4.Text = c.ToString();
}
if (c >= 60)
{
c = 0;
d++;
label6.Text = d.ToString();
}
}
}
}
Asad AliPosted Apr 13, 2016, 1:40 PM