-1
Mens, I’m taking a DS technical course, I’m in the TCM phase and I was wondering if you can solve or help me with this problem:
Next: I am doing a CRUD in c# win Forms and I came across an error where when I call a form through a button, the same instead of opening with a click it is necessary to use two (double click to open screens). To call another form use this following method:
private void abrirJanela(object conteudo)
{
if (this.panelfake.Controls.Count > 0)
this.panelfake.Controls.RemoveAt(0);
Form janela = conteudo as Form;
janela.TopLevel = false;
janela.Dock = DockStyle.Fill;
this.panelfake.Controls.Add(janela);
this.panelfake.Tag = janela;
janela.Show();
pictureBox2.Hide(); //esconde imagem do home
}
In the method it is noticed that I describe a part to close the open screens (or at least I think this is it), only it happens that it does not close, I mean, it closes with two clicks. I believe it’s overlapping.
Below I will be leaving a short video where I will show the problem:
As of now, grateful
Without more details there is no way to help you. The problem may be in that initial if, it may be time to open the screen, anything...
– Jéf Bueno
is kind of hard to understand, but come on... you’re wanting to redo the functionality of MDI Parent / Child, which is to open the form inside another form... ? , along with this, it would take 2 clicks to open the form, and if another form opens, the previous one should close ? Obs. Removing the form from the fake panel will not close it.
– Rovann Linhalis