Its simple C# coding, and these are some basic things :

1. Any variable that you want to check across functions, or store it during a program's instance execution, can be stored as a member variable.
2. You can also use the Tag value of the button to store how many times they clicked, avoiding a member variable i.
button1.Tag = Int32.Parse(button1.Tag) + 1;

Regards,
CT.

Check out www.cuteassistant.com - Manage your tasks, take notes, securely store data and more!