private void txt_Password_KeyPress(object sender, KeyPressEventArgs e) { if (SpaceEntered == true) { e.Handled = true; } }