private void button7_Click(object sender, EventArgs e) { var form = new ChooseDubbedPieceWhite(); form.Location = this.Location; form.ShowDialog(); // code will freeze here until that form is closed string chosen = form.chosen; }
private string Promote(int i) { var form1 = new ChooseDubbedPieceWhite(); var form2 = new ChooseDubbedPieceBlack(); string chosen; if (i == 0) { form1.Location = this.Location; form1.ShowDialog(); chosen = form1.chosen; } else { form2.Location = this.Location; form2.ShowDialog(); chosen = form2.chosen; } // code will freeze here until that form is closed return(chosen); }