private void frmmain_Load(object sender, EventArgs e) { Opacity = 0; timer1.Enabled = true; common.main = this; var sidebar = new frmsidebar(); var login = new frmlogin(); var viewres = new frmdgview(); common.mnubar = mnubar; common.login = login; common.sidebar = sidebar; common.viewres = viewres; common.login.MdiParent = this; Location = new Point(0, 0); Size = Screen.PrimaryScreen.WorkingArea.Size; sidebar.MdiParent = this; viewres.MdiParent = this; //f1.MdiParent = this; sidebar.Dock = DockStyle.Left; //Sidebar viewres.Dock = DockStyle.Right; common.login.Show(); }
private void logoutToolStripMenuItem_Click(object sender, EventArgs e) { for (int i = Application.OpenForms.Count - 1; i >= 0; i--) { if (Application.OpenForms[i].Name != "frmmain") Application.OpenForms[i].Close(); } mnubar.Items["mnuadd"].Visible = false; mnubar.Items["mnusearch"].Visible = false; mnubar.Enabled = false; mnusrname.Text = ""; var login = new frmlogin(); login.MdiParent = this; common.login = login; common.login.Show(); }