0
In my program, I need the following routine to work:
private void FuncaoTal()
{
frmSelecao.FormClosing += atualizarEvento;
SplitContMenu.Panel2.Controls.Clear();
splitContMenu.Panel2.Controls.Add(frmSelecao);
frmSelecao.Show();
}
private void atualizarEvento(Object sender, EventArgs e)
{
if (ContaAtiva.id == 0)
{
sender(as Form).FormClosed += carregarLogoVanguarda;
}
else
{
sender(as Form).FormClosed += acessarMenuMovimentacoes;
}
}
public void acessarMenuMovimentacoes(object sender, EventArgs e)
{
frmMenuMovimentacao frm = new frmMenuMovimentacao();
frm.AutoScroll = true;
frm.Dock = DockStyle.Fill;
frm.TopLevel = false;
splitContMenu.Panel2.Controls.Clear();
splitContMenu.Panel2.Controls.Add(frm);
frm.FormClosed += carregarLogoVanguarda;
if (ContaAtiva.id > 0)
{
frm.Show();
}
}
private void carregarLogoVanguarda(object sender, EventArgs e)
{
PictureBox picBoxLogo = new PictureBox();
picBoxLogo.Image = global::InterfaceVisual.Properties.Resources.Logo_Vanguarda;
picBoxLogo.Dock = DockStyle.Fill;
picBoxLogo.SizeMode = PictureBoxSizeMode.CenterImage;
picBoxLogo.BackColor = Color.White;
splitContMenu.Panel2.Controls.Clear();
splitContMenu.Panel2.Controls.Add(picBoxLogo);
}
I’m not getting to make the event update routine work.
My intention is that when the user selects an account on the selection screen, the screen will be closed and in its place another one will be opened. Otherwise, it will carry the home screen again.
P.S.: I am using SplitContainer
. The screens are loaded in the panel 2
his.
Just by supplementing your answer, the syntax would be: (Sender as Form). Formclosed += chargeLogoVanguard;
– 00lenon