CHECKBOX

05/11/2004 - 19:27 por grissss | Informe spam
hola

pues veran esto es muy sencillo, pero no me sale bien
pueden creerlo?

tengo que validar un checbox para activar una caja de
texto, pero no funciona no me habilita el textbox. checa
mi codigo esta asi:

private void chBxClave_CheckedChanged(object sender,
System.EventArgs e)

{
if (this.chBxClave.Checked == false)
this.txtClave .Enabled = false;
else
this.txtClave .Enabled = true;
}

MIL GRACIASSS!!!
 

Leer las respuestas

#1 A.Poblacion
05/11/2004 - 20:05 | Informe spam
A ver si es que no le has puesto al checkbox la propiedad autopostback=true,
y por eso no te está ejecutando el código que has escrito en el servidor.

Por cierto, todo ese bloque "if" que has escrito se puede suprimir
sustituyéndolo por esta única sentencia:

this.txtClave.Enabled=this.chBxClave.Checked;


"grissss" wrote in message
news:479001c4c365$21c1d1c0$
hola

pues veran esto es muy sencillo, pero no me sale bien
pueden creerlo?

tengo que validar un checbox para activar una caja de
texto, pero no funciona no me habilita el textbox. checa
mi codigo esta asi:

private void chBxClave_CheckedChanged(object sender,
System.EventArgs e)

{
if (this.chBxClave.Checked == false)
this.txtClave .Enabled = false;
else
this.txtClave .Enabled = true;
}

MIL GRACIASSS!!!

Preguntas similares