I have 2 forms. The main one contains a button that opens the second form inside the main.
private void btnCalculadora_Click(object sender, EventArgs e)
{
Calculadora = new frmCalculadora();
Calculadora.TopLevel = false;
Calculadora.Visible = true;
this.Controls.Add(this.Calculadora);
Calculadora.Location = new Point(210, 40);
}
However, when the secondary was opened, it was selected so that the KeyPress event of the secondary form would work, but Calculator.TopLevel = false; does not allow it.
Note: Leaving TopLevel = true / this.Controls.Add (this.Calculator); of the error.