private void Main_Load(object sender, EventArgs e) { XmlBLL xmlBLL = new XmlBLL(); xmlBLL.GetSysteminfo(); if (Systeminfo.Status == true) { Mp3Player.open(Systeminfo.FileNameSound); Mp3Player.Volume(100); Mp3Player.play(); } // Subscribe Event //Event registration choose.Load_test += Load_test; btnLogout.Click += btnhomen_Click; ResultTest.Instance.close_test += close_UcQuestion; ResultTest.Instance.new_test += new_test; try { if (!String.IsNullOrEmpty(DataInfoUser.usernamelogin)) { txtUsername.Text = DataInfoUser.usernamelogin; pBUser.Image = DataInfoUser.imguser; } else { txtUsername.Text = "NoUser"; btnLogout.Visible = false; btnLogin.Visible = true; } } catch (Exception) { } if (DataInfoUser.Admin == true) { btnAdmin.Visible = true; txtUsername.ForeColor = Color.Red; } else { txtUsername.ForeColor = Color.DarkBlue; } checkuser(); this.TopMost = false; this.Enabled = true; }
private async void btninternet_Click(object sender, EventArgs e) { Mp3Player.Pause(); Systeminfo.Status = false; Ucinternet ucinternet = Ucinternet.Instance; pnlMain.Controls.Clear(); panelDockL.Visible = false; pnlMain.Controls.Add(panelDockL); pnlMain.Visible = false; pnlMain.Controls.Add(ucinternet); pnlMain.Visible = true; panelleft.Height = btninternet.Height; panelleft.Top = btninternet.Top; }