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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
CheckBox[] checkBoxs;
private void Form1_Load(object sender, EventArgs e)
{
checkBoxs = new CheckBox[]
{
checkBox1,checkBox2,checkBox3,checkBox4,checkBox5,
};
for (int i = 0; i < checkBoxs.Length; i++)
{
checkBoxs[i].CheckedChanged += new EventHandler(checkBoxs_CheckedChanged);
checkBoxs[i].Tag = i + 1;
}
}
void checkBoxs_CheckedChanged(object sender, EventArgs e)
{
var ckbk = (CheckBox)sender;
int Number = (int)ckbk.Tag;
this.Text = Number.ToString();
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkNvbXBvbmVudE1vZGVsOwp1c2luZyBTeXN0ZW0uRGF0YTsKdXNpbmcgU3lzdGVtLkRyYXdpbmc7CnVzaW5nIFN5c3RlbS5MaW5xOwp1c2luZyBTeXN0ZW0uVGV4dDsKdXNpbmcgU3lzdGVtLldpbmRvd3MuRm9ybXM7CgpuYW1lc3BhY2UgV2luZG93c0Zvcm1zQXBwbGljYXRpb24xCnsKICAgIHB1YmxpYyBwYXJ0aWFsIGNsYXNzIEZvcm0xIDogRm9ybQogICAgewogICAgICAgIHB1YmxpYyBGb3JtMSgpCiAgICAgICAgewogICAgICAgICAgICBJbml0aWFsaXplQ29tcG9uZW50KCk7CiAgICAgICAgfQogICAgICAgIENoZWNrQm94W10gY2hlY2tCb3hzOwogICAgICAgIHByaXZhdGUgdm9pZCBGb3JtMV9Mb2FkKG9iamVjdCBzZW5kZXIsIEV2ZW50QXJncyBlKQogICAgICAgIHsKICAgICAgICAgICAgY2hlY2tCb3hzID0gbmV3IENoZWNrQm94W10KICAgICAgICAgICAgewogICAgICAgICAgICAgICAgY2hlY2tCb3gxLGNoZWNrQm94MixjaGVja0JveDMsY2hlY2tCb3g0LGNoZWNrQm94NSwKICAgICAgICAgICAgfTsKICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjaGVja0JveHMuTGVuZ3RoOyBpKyspCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGNoZWNrQm94c1tpXS5DaGVja2VkQ2hhbmdlZCArPSBuZXcgRXZlbnRIYW5kbGVyKGNoZWNrQm94c19DaGVja2VkQ2hhbmdlZCk7CiAgICAgICAgICAgICAgICBjaGVja0JveHNbaV0uVGFnID0gaSArIDE7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHZvaWQgY2hlY2tCb3hzX0NoZWNrZWRDaGFuZ2VkKG9iamVjdCBzZW5kZXIsIEV2ZW50QXJncyBlKQogICAgICAgIHsKICAgICAgICAgICAgdmFyIGNrYmsgPSAoQ2hlY2tCb3gpc2VuZGVyOwogICAgICAgICAgICBpbnQgTnVtYmVyID0gKGludClja2JrLlRhZzsKICAgICAgICAgICAgdGhpcy5UZXh0ID0gTnVtYmVyLlRvU3RyaW5nKCk7CiAgICAgICAgfQogICAgfQp9Cg==