Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/10/2005, 04:30
kakarot
 
Fecha de Ingreso: diciembre-2003
Mensajes: 288
Antigüedad: 20 años, 4 meses
Puntos: 0
Keypress en combo box

Buenas

Se puede utilizar el evento keypress en un como box?¿, ya q he puesto:

private void cmbPerfil_KeyPress(object sender,KeyPressEventArgs e)
{
if( (char.IsDigit(e.KeyChar) || char.IsControl(e.KeyChar)) )
{
e.Handled=true;
}
}

Con el objetivo q no pueda escribir en el comobo, solo cargar lo q tiene, pero cuando pongo debugar parece q ignore ese evento

Tb he puesto:
// cmbPerfil
//
this.cmbPerfil.Location = new System.Drawing.Point(88, 184);
this.cmbPerfil.Name = "cmbPerfil";
this.cmbPerfil.Size = new System.Drawing.Size(120, 21);
this.cmbPerfil.TabIndex = 5;
this.cmbCPerfil.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cmb Perfil_KeyPress);


GRACIAS