private void button1_Click(object sender, EventArgs e) { bool chechPassword = false; if (textBox1.Text == "" & textBox2.Text == "") { MessageBox.Show("Введите данные", "Ошибка", MessageBoxButtons.OK); } else { foreach (Autorization author in Program.sinDB.Autorization) { if (textBox1.Text == author.Login & textBox2.Text == author.Password) { chechPassword = true; } } } if (chechPassword) { FormMenu Menu = new FormMenu(); textBox1.Text = ""; textBox2.Text = ""; this.Hide(); Menu.Show(); } else { MessageBox.Show("Данные введены неверно", "Ошибка", MessageBoxButtons.OK); textBox1.Text = ""; textBox2.Text = ""; } }
public void Back() { Form menu = new FormMenu(); this.Hide(); menu.Show(); }
private void buttonClients_Click(object sender, EventArgs e) { FormMenu Menu = new FormMenu(); Menu.StartPosition = FormStartPosition.Manual; Menu.Left = this.Left; Menu.Top = this.Top; this.Hide(); Menu.Show(); }