Advertisement
Guest User

Untitled

a guest
Jul 10th, 2012
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. public Form1()
  2. {
  3. InitializeComponent();
  4.  
  5. initTimers();
  6. }
  7.  
  8. public void timer1_Tick(object sender, EventArgs e)
  9. {
  10. progressBar1.Increment(1);
  11. }
  12.  
  13. private void button1_Click(object sender, EventArgs e)
  14. {
  15. if (button1.Text == "Go")
  16. {
  17. timer1.Start();
  18. button1.Text = "Stop";
  19. }
  20. else
  21. {
  22. timer1.Stop();
  23. button1.Text = "Go";
  24. }
  25. }
  26.  
  27. public void initTimers()
  28. {
  29. timer1.Tick += new EventHandler(timer1_Tick);
  30. timer1.Interval = 1000;
  31. }
  32.  
  33. public void progressTimers()
  34. {
  35. progressBar1.Value = 0;
  36. progressBar1.Minimum = 0;
  37. progressBar1.Maximum = 2;
  38. progressBar1.Step = 1;
  39. progressBar1.Visible = true;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement