how to add the voice of clock in the stopwatch
Code for making stopwatch in visual basic
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Asad Ali5 pointsPosted Apr 13, 2016, 10:40 AM EDT
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();
}
}
}
}
1 short reply
Asad Ali5 pointsPosted Apr 13, 2016, 9:40 AM EDT