Skip to content

Code for making stopwatch in visual basic

sana sajjad

sana sajjad

Asked Apr 13, 2016, 7:37 AM EDT2 answers
Share
LinkedInX
how to add the voice of clock in the stopwatch

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    please write folling codefor tik sound generation .I am from shiblee college.
     
    using System;
    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();
    }

    }


    }
    }

    0
  • 1 short reply
    • 0
      wait ....
      0