private void LeitorCodBarras_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Titulo)) { lblTitulo.Text = Titulo; } TxtLeitura.Focus(); TxtLeitura.Select(); }
private void TxtLeitura_TextChanged(object sender, EventArgs e) { if (TxtLeitura.Text.Length.Equals(10)) { Leitura = TxtLeitura.Text; DialogResult = DialogResult.OK; } else if (TxtLeitura.Text.Length > 10) { TxtLeitura.Text = ""; TxtLeitura.Focus(); TxtLeitura.Select(); } }