Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 Homework
- {
- public partial class Form1 : Form
- {
- private bool stopped;
- public Form1()
- {
- InitializeComponent();
- }
- private void btngreeting_Click(object sender, EventArgs e)
- {
- stopped = !stopped;
- btngreeting.Text = stopped ? "Start" : "Stop";
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- if (stopped == false)
- {
- if (lblhello.Text == "Hello")
- lblhello.Text = "Goodbye";
- else
- lblhello.Text = "Hello";
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment