private void salesToolStripMenuItem_Click(object sender, EventArgs e) { try { if (LoginCodeClass.IsLogged == false) { throw new Exception("Login first."); } else { SALES sl = new SALES(); MainClass.ShowWindow(sl, MDI.ActiveForm); } } catch (Exception ex) { MainClass.ShowMsg(ex.Message, "Error"); } }