private void TxtBoxLoginUsuario_Leave(object sender, EventArgs e) { if (TxtBoxLoginUsuario.Text.Trim().Equals("")) { TxtBoxLoginUsuario.Text = "Usuario..."; this.IsValidUsername = false; } else { if (db.ComprobarExisteUsuario(TxtBoxLoginUsuario.Text.Trim())) { BtnLoginRegistrer.Text = "LOGIN"; LblMensaje.Visible = false; this.IsLogin = true; ImgPerfil.Image = db.GetImagenUsuario(TxtBoxLoginUsuario.Text.Trim()); ImgPerfil.Visible = true; // ImgPerfil.BringToFront(); BtnImagenUsuario.SendToBack(); } else { BtnLoginRegistrer.Text = "REGISTRER"; this.IsLogin = false; LblMensaje.Text = "Advertencia!!!: Vas a crear un nuevo usuario"; LblMensaje.Visible = true; ImgPerfil.Image = null; BtnImagenUsuario.BringToFront(); } this.IsValidUsername = true; } }