private void cmdLogin_Click(object sender, EventArgs e) { bool is_valid; bool validate; server.Service1 server = new server.Service1(); server.Login(txtUsername.Text, txtPassword.Text, out is_valid, out validate); if (is_valid == true) { this.Hide(); UserPortal up = new UserPortal(); up.Show(); } else { MessageBox.Show("Invalid username and password."); } }