public frmMain(ContactsListController controller) { InitializeComponent(); _currentProcess = CurrentProcess.Init; _message = "0"; _controller = controller; _hasEmailException = false; _hasDate = false; #region TEXTBOX ADD EVENTS txtFullName.GotFocus += txtFullName_GotFocus; txtFullName.Click += txtFullName_Click; txtFullName.KeyPress += txtFullName_KeyPress; txtFullName.KeyDown += txtFullName_KeyDown; txtFullName.TextChanged += txtFullName_TextChanged; txtEmail.GotFocus += txtEmail_GotFocus; txtEmail.Click += txtEmail_Click; txtEmail.KeyPress += txtEmail_KeyPress; txtEmail.KeyDown += txtEmail_KeyDown; txtPhone.GotFocus += txtPhone_GotFocus; txtPhone.Click += txtPhone_Click; txtPhone.KeyPress += txtPhone_KeyPress; txtPhone.KeyDown += txtPhone_KeyDown; txtPhone.TextChanged += txtPhone_TextChanged; txtBirth.ValueChanged += txtBirth_ValueChanged; #endregion }
static void Main() { var controller = new ContactsListController(); controller.ReadContacts(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmMain(controller)); }