public static FRM_Depts Instance() { if (instance == null) { instance = new FRM_Depts(); } return(instance); }
public FRM_CadDept(int operacao, int id_dept, FRM_Depts form_depts) { InitializeComponent(); id_departamento = id_dept; op = operacao; form_deptsLocal = form_depts; txtDept.CharacterCasing = CharacterCasing.Upper; if (id_dept != 0) { VisualizarDept(); } }
public void mDept_Click(object sender, EventArgs e) { for (int intIndex = Application.OpenForms.Count - 1; intIndex > 0; intIndex--) { if (Application.OpenForms[intIndex] != this) { Application.OpenForms[intIndex].Close(); } } FRM_Depts form_Dept = FRM_Depts.Instance(); form_Dept.MdiParent = this; form_Dept.Show(); }
private void FRM_Depts_FormClosed(object sender, FormClosedEventArgs e) { instance = null; }