private void AbrirRotina(Acesso.IRKO.Menu _menu) { Controles.BaseForm _form = null; cbbFormulario.Items.Cast <Controles.BaseForm>().ToList() .ForEach(_formulario => { if (_formulario.GetMenu().Menu1 == _menu.Menu1) { _form = _formulario; //_form.Show(); } else { _formulario.Hide(); } }); if (_form is null) { _form = (Controles.BaseForm)Activator.CreateInstance(Type.GetType(_menu.Programa), this); _form.SetMenu(_menu); _form.Width = spcDesktop.Panel2.Width - lblHideShow.Width; _form.Height = spcDesktop.Panel2.Height - pnlSuperior.Height; _form.Left = lblHideShow.Width; _form.Top = pnlSuperior.Height; cbbFormulario.Items.Add(_form); spcDesktop.Panel2.Controls.Add(_form); CheckSelectedCbbFormulario(); } try { _form.Show(); } catch { } }
public void CustomForm_Close(Controles.BaseForm _form) { cbbFormulario.Items.Remove(_form); spcDesktop.Panel2.Controls.Remove(_form); CheckSelectedCbbFormulario(); }