Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace projekt
- {
- public partial class Programowanie : Form
- {
- int godziny, minuty, sekundy, setne_sekundy = 0;
- public Programowanie()
- {
- InitializeComponent();
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- label1.Text = godziny+":"+minuty+":"+sekundy+":" + setne_sekundy.ToString();
- setne_sekundy++;
- if (setne_sekundy>10)
- {
- sekundy++;
- setne_sekundy = 0;
- }
- else
- {
- setne_sekundy = 0;
- }
- if(sekundy>60)
- {
- minuty++;
- sekundy = 0;
- }
- if (minuty > 60)
- {
- godziny++;
- minuty = 0;
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- timer1.Start();
- }
- private void button2_Click(object sender, EventArgs e)
- {
- timer1.Stop();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment