private void Main_Load(object sender, EventArgs e) { // login login_form = new login(); // login_form.ShowDialog(); if (SharedVariables.is_user_logged) { UserLoggedTxt.Text = SharedVariables.user_logged_name + ": " + SharedVariables.user_logged_name_name; LogOutLabel.Visible = true; // LogOutBtn.Visible = true; DateTime Date = DateTime.Now; toolDate.Text = Date.ToShortDateString(); timer1.Start(); UpdateMain(); MainDock aMainDock = new MainDock(); aMainDock.Text = "Home"; aMainDock.WindowState = FormWindowState.Maximized; aMainDock.MdiParent = this; aMainDock.Show(); } else { Application.Exit(); } }
private void HomeToolStripMenuItem_Click(object sender, EventArgs e) { MainDock aMainDock = new MainDock(); // aMainDock.MdiParent = Helper.Instance.ActiveMainWindow; aMainDock.Show(); }
private void LoginAgainAfterLogout() { login login_form = new login(); login_form.IsFirstLogin = true; login_form.Show(); Application.Restart(); if (SharedVariables.is_user_logged) { UserLoggedTxt.Text = SharedVariables.user_logged_name + ": " + SharedVariables.user_logged_name_name; LogOutLabel.Visible = true; // LogOutBtn.Visible = true; DateTime Date = DateTime.Now; toolDate.Text = Date.ToShortDateString(); timer1.Start(); UpdateMain(); MainDock aMainDock = new MainDock(); aMainDock.Text = "aMainDock"; aMainDock.MdiParent = this; aMainDock.Show(); // aMainDock.FormBorderStyle = FormBorderStyle.None; //aMainDock.Dock = DockStyle.Fill; // aMainDock.Size = new Size(this.Width - 300, this.Height - 300); } else { Application.Exit(); } }