private void button1_Click(object sender, EventArgs e) { if (logar()) { Inicial nf = new Inicial();//Object of the form that you want to open this.Hide();//Hide cirrent form. nf.Show();//Display the next form window } else { MessageBox.Show("Acesso não permitido"); } }
private void button2_Click(object sender, EventArgs e) { Inicial nf = new Inicial();//Object of the form that you want to open this.Hide();//Hide cirrent form. nf.Show();//Display the next form window }