private void MetroTileMenu_Click(object sender, EventArgs e) { try { MetroTile menuClick = (MetroTile)sender; MetroFramework.Forms.MetroForm oForm = new MetroFramework.Forms.MetroForm(); string dll = "UI2"; Assembly assCadena = Assembly.LoadFrom(AppDomain.CurrentDomain.BaseDirectory + dll + ".dll"); oForm = (MetroFramework.Forms.MetroForm)assCadena.CreateInstance("UI2.frm_" + menuClick.Name); oForm.MdiParent = this; oForm.Dock = DockStyle.Fill; oForm.StartPosition = FormStartPosition.CenterParent; oForm.BringToFront(); oForm.WindowState = FormWindowState.Maximized; oForm.MaximizeBox = false; oForm.MinimizeBox = false; ContenedorPrincipal.Visible = false; oForm.FormClosed += OForm_FormClosed; oForm.Show(); } catch (Exception ex) { //throw new Exception(); } }
private void AbrirFormulario(string ruta) { try { MetroFramework.Forms.MetroForm oForm = new MetroFramework.Forms.MetroForm(); string dll = "UI2"; Assembly assCadena = Assembly.LoadFrom(AppDomain.CurrentDomain.BaseDirectory + dll + ".dll"); oForm = (MetroFramework.Forms.MetroForm)assCadena.CreateInstance(ruta); oForm.MdiParent = Padre; oForm.FormClosed += OForm_FormClosed; //oForm.Dock = DockStyle.Fill; oForm.StartPosition = FormStartPosition.CenterParent; oForm.BringToFront(); oForm.Show(); pnlPrincipal.Visible = false; } catch (Exception ex) { //throw new Exception(); } }
public void LoadForm(MetroFramework.Forms.MetroForm frm) { frm.MdiParent = this; frm.BringToFront(); frm.ShowDialog(); }