2
I have an application in C# and I wonder if it would be like when I press the add button (whose arrow is pointing in the image) this form that is in light blue inside a Panel if it closes and opens another form that in case would be the frmCadastro.
I was using this code to see if it opened, but without success:
frmPaginaInicial pg = new frmPaginaInicial();
pg.painelMenu.Controls.Clear();
Leitor.frmAddLeitor ad = new Leitor.frmAddLeitor();
ad.TopLevel = false;
ad.Dock = DockStyle.Fill;
ad.FormBorderStyle = FormBorderStyle.None;
pg.painelMenu.Controls.Add(ad);
ad.Show();

Does it give any error? Put more details in your question pf.
– João Martins
A question, you said in the question that you would like to open the form
frmCadastro, but in your code is creating the formfrmAddLeitor. After all, which form would you like to open?– Pedro Paulo
I already managed to find the solution, but thanks for the attention John
– Felipe