private void Button1_Click(object sender, EventArgs e) { id = userLogic.Authorizate(textBox1.Text, textBox2.Text); if (id > 0) { MainForm form = new MainForm(); form.Show(); Hide(); } else { MessageBox.Show("Invalid login or password"); } }