fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace WindowsFormsApplication1
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. }
  18. CheckBox[] checkBoxs;
  19. private void Form1_Load(object sender, EventArgs e)
  20. {
  21. checkBoxs = new CheckBox[]
  22. {
  23. checkBox1,checkBox2,checkBox3,checkBox4,checkBox5,
  24. };
  25. for (int i = 0; i < checkBoxs.Length; i++)
  26. {
  27. checkBoxs[i].CheckedChanged += new EventHandler(checkBoxs_CheckedChanged);
  28. checkBoxs[i].Tag = i + 1;
  29. }
  30. }
  31.  
  32. void checkBoxs_CheckedChanged(object sender, EventArgs e)
  33. {
  34. var ckbk = (CheckBox)sender;
  35. int Number = (int)ckbk.Tag;
  36. this.Text = Number.ToString();
  37. }
  38. }
  39. }
  40.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty