public void clickHandler(object sender, System.EventArgs e) {...}
button1.Click += new EventHandler(clickHandler);
button2.Click += new EventHandler(clickHandler);
button3.Click += new EventHandler(clickHandler);
foreach (Control ctrl in myGroupBox.Controls)
{
ctrl.Click += new EventHandler(clickHandler);
}
public class Auth {
public string Login {get; set;}
public string Password {get; set;}
}
var AuthList = new List<Auth>();
var auth = new Auth(){Login: "login123", Password: "pass"};
AuthList.Add(auth);
DialogResult result = MessageBox.Show("Сохранить введеные данные", "Сохранение", MessageBoxButtons.YesNo);
if(result == DialogResult.Yes){
//yes
}
else if(result == DialogResult.No){
//no
}