Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void AbrirFormulario(Type formType)
- {
- pnFormulários.Enabled = true;
- pnFormulários.Visible = true;
- this.SuspendLayout();
- if (btVoltarInicio.Enabled == false)
- {
- try
- {
- for (int i = 0; i < lstFormulario.Count; i++)
- {
- lstFormulario[i].Close();
- lstFormulario[i].Dispose();
- lstFormulario[i] = null;
- }
- lstFormulario.Clear();
- Form form = (Form)Activator.CreateInstance(formType);
- form.WindowState = FormWindowState.Maximized;
- form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
- form.TopLevel = false;
- pnFormulários.Controls.Add(form);
- form.Show();
- lstFormulario.Add(form);
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.ToString());
- }
- this.ResumeLayout(true);
- btVoltarInicio.Enabled = true;
- btVoltarInicio.Visible = true;
- }
- else
- {
- }
- }
- private void btCadCategorias_Click(object sender, EventArgs e)
- {
- AbrirFormulario(typeof(cadastro_categoria));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement