private void txtCodMotorista_TextChanged(object sender, EventArgs e) { if (String.IsNullOrWhiteSpace(txtCodMotorista.Text.Trim()) || !Int32.TryParse(txtCodMotorista.Text.Trim(), out int i)) { txtMotorista.Text = ""; return; } txtMotorista.Text = Motorista.Buscar(i); }