public static FrmMain1 Func() { if (objMain == null || objMain.IsDisposed) { objMain = new FrmMain1(); } return objMain; }
public static void MainFormBUttonSettings(string Mode, bool value ) { objMain = Program.Func(); switch (Mode) { case MainLoad: { objMain.btnPreview.Enabled = value; objMain.btnPrint.Enabled = value; objMain.btnExportWord.Enabled = value; objMain.btnExportExcel.Enabled = value; objMain.btnExportPDF.Enabled = value; objMain.btnEdit.Enabled = value; objMain.btnFind.Enabled = value; objMain.btnBaseDocument.Enabled = value; objMain.btnSorting.Enabled = value; objMain.btnFormSettings.Enabled = value; objMain.btnRelationShipMap.Enabled = value; objMain.btnGrossProfit.Enabled = value; objMain.btnLayoutDesigner.Enabled = value; objMain.btnTargetDocument.Enabled = value; objMain.btnNextRecord.Enabled = value; objMain.btnPreviousRecord.Enabled = value; objMain.btnFirstRecord.Enabled = value; objMain.btnLastRecord.Enabled = value; objMain.btnFilter.Enabled = value; objMain.btnJournalEntryPreview.Enabled = value; break; } case FormLoad: { objMain.btnFind.Enabled = value; objMain.btnFormSettings.Enabled = value; objMain.btnNextRecord.Enabled = value; objMain.btnPreviousRecord.Enabled = value; objMain.btnFirstRecord.Enabled = value; objMain.btnLastRecord.Enabled = value; objMain.btnEdit.Enabled = false; objMain.btnAdd.Enabled = false; objMain.btnPreview.Enabled = false; objMain.btnPrint.Enabled = false; objMain.btnExportWord.Enabled = false; objMain.btnExportExcel.Enabled = false; objMain.btnExportPDF.Enabled = false; objMain.btnBaseDocument.Enabled = false; objMain.btnSorting.Enabled = false; objMain.btnRelationShipMap.Enabled = false; objMain.btnGrossProfit.Enabled = false; objMain.btnLayoutDesigner.Enabled = false; objMain.btnTargetDocument.Enabled = false; objMain.btnFilter.Enabled = false; objMain.btnJournalEntryPreview.Enabled = false; break; } case FormWithGrid: { objMain.btnPreview.Enabled = value; objMain.btnPrint.Enabled = value; objMain.btnExportWord.Enabled = value; objMain.btnExportExcel.Enabled = value; objMain.btnExportPDF.Enabled = value; objMain.btnEdit.Enabled = value; objMain.btnFind.Enabled = value; objMain.btnBaseDocument.Enabled = value; objMain.btnFormSettings.Enabled = value; objMain.btnRelationShipMap.Enabled = value; objMain.btnGrossProfit.Enabled = value; objMain.btnTargetDocument.Enabled = value; objMain.btnNextRecord.Enabled = value; objMain.btnPreviousRecord.Enabled = value; objMain.btnFirstRecord.Enabled = value; objMain.btnLastRecord.Enabled = value; objMain.btnJournalEntryPreview.Enabled = value; break; } case Report: { objMain.btnEdit.Enabled = false; objMain.btnFind.Enabled = false; objMain.btnFormSettings.Enabled = false; objMain.btnNextRecord.Enabled = false; objMain.btnPreviousRecord.Enabled = false; objMain.btnFirstRecord.Enabled = false; objMain.btnLastRecord.Enabled = false; objMain.btnPreview.Enabled = value; objMain.btnPrint.Enabled = value; objMain.btnExportWord.Enabled = false; objMain.btnExportExcel.Enabled = false; objMain.btnExportPDF.Enabled = false; objMain.btnBaseDocument.Enabled = false; objMain.btnSorting.Enabled = false; objMain.btnRelationShipMap.Enabled = false; objMain.btnGrossProfit.Enabled = false; objMain.btnLayoutDesigner.Enabled = false; objMain.btnTargetDocument.Enabled = false; objMain.btnFilter.Enabled = false; objMain.btnJournalEntryPreview.Enabled = false; break; } } }