private void button3_Click(object sender, EventArgs e) { AllVariants child = new AllVariants(this.firstname, this.lastname, this.address, this.phone_number); child.FormClosed += new FormClosedEventHandler(child_FormClosed); //add handler to catch when child form is closed child.Show(); //show child this.Hide(); //hide parent }
private void button1_Click(object sender, EventArgs e) { Database database = new Database(); database.SignUpNewClient(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text); AllVariants child = new AllVariants(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text); child.FormClosed += new FormClosedEventHandler(child_FormClosed); //add handler to catch when child form is closed child.Show(); //show child this.Hide(); //hide parent }
private void button1_Click(object sender, EventArgs e) { Database database = new Database(); List <string> vs = database.SignIn(textBox1.Text, textBox2.Text); if (vs.Count != 0) { AllVariants child = new AllVariants(vs[0], vs[1], vs[2], vs[3]); //create new isntance of form child.FormClosed += new FormClosedEventHandler(child_FormClosed); //add handler to catch when child form is closed child.Show(); //show child this.Hide(); //hide parent } }