private void BtnLogin_Click(object sender, EventArgs e) { AuthApp authApp = new AuthApp(tbUserName.Text.Trim(), tbPassword.Text); //AuthApp authApp = new AuthApp("nfsiam", "1234");//bypass //AuthApp authApp = new AuthApp("dumbo", "abcd");//bypass //Task<User> task = new Task<User>(authApp.GetProfile); //task.Start(); user = authApp.GetProfile(); if (user == null) { MessageBox.Show("No login information found for provided username and password", "Not Found", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { //Volume.On(); if (this.Parent.Parent is Landing) { point = this.Parent.Parent.Location; } Thread th = new Thread(ShowUserEnd); th.SetApartmentState(ApartmentState.STA); th.Start(); if (this.Parent.Parent is Landing) { (this.Parent.Parent as Landing).Close(); } } }