Subo Cambio 555
This commit is contained in:
@@ -28,6 +28,7 @@ namespace compabetov2.Ventas
|
||||
this.envio = envio;
|
||||
this.detallesEnvio = detallesEnvio;
|
||||
this.ventanaPadre = ventanaPadre;
|
||||
txtTelefono.KeyPress += new KeyPressEventHandler(txtTelefono_KeyPress);
|
||||
}
|
||||
|
||||
|
||||
@@ -207,5 +208,25 @@ namespace compabetov2.Ventas
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void txtTelefono_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void txtTelefono_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
// Verificar si la tecla presionada no es un número o la tecla de retroceso
|
||||
if (!char.IsDigit(e.KeyChar) && e.KeyChar != 8)
|
||||
{
|
||||
e.Handled = true; // Ignorar la tecla presionada
|
||||
|
||||
// Mostrar un mensaje indicando que solo se permiten números
|
||||
MessageBox.Show("Por favor, ingrese solo números en el teléfono.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user