2
I have 3 forms, Main, product and details. In the main form I have a side menu and a panel called pnlContent. In this menu I have a button that fills the pnlContent with the product form. Inside the product form I have another button that fills the pnlContent with the form Details but does not display. They could help me?
(Main form)Call to the product form:
private void btnProduto_Click(object sender, EventArgs e)
{
frmProduto frm = new frmProduto
{
TopLevel = false,
AutoScroll = true,
FormBorderStyle = FormBorderStyle.None,
Dock = DockStyle.Fill
};
this.pnlContent.Controls.Clear();
this.pnlContent.Controls.Add(frm);
frm.Show();
}
(Form Product)Call to form details:
private void btnDetalhes_Click(object sender, EventArgs e)
{
frmDetalhes Detalhes = new frmDetalhes
{
TopLevel = false,
AutoScroll = true,
FormBorderStyle = FormBorderStyle.None,
Dock = DockStyle.Fill
};
frmPrincipal Principal = new frmPrincipal();
Principal.pnlContent.Controls.Clear();
Principal.pnlContent.Refresh();
Principal.pnlContent.Controls.Add(Detalhes);
Detalhes.Show();
Principal.Refresh();
Principal.pnlContent.Refresh();
this.Close();
}
Let me see if I understand, you carry the product form on
pnlContent
from the main and to and from the product you want to replace the content of thepnlContent
the details form of that product?– Leandro Angelo
Managed to solve??
– Leandro Angelo