private void Numero_KeyPress(object sender, KeyPressEventArgs e) { char digitoSaida = '0'; bool verificado = false; //Aciona o botão Laranja var newstate = Symbol.Keyboard.KeyStates.KEYSTATE_NUMERIC_LOCK; Symbol.Keyboard.KeyPad teste = new Symbol.Keyboard.KeyPad(); teste.SetKeyState(newstate, 0, true); if (((TextBox)sender).Text.Length == 9 && e.KeyChar != Convert.ToChar(8)) { e.Handled = true; return; } verificado = new Util.Mask().ApenasNumero(e.KeyChar, ref digitoSaida); if (verificado) { ((TextBox)sender).Text = ((TextBox)sender).Text + digitoSaida; ((TextBox)sender).SelectionStart = ((TextBox)sender).Text.Length; e.Handled = true; } else { if (e.KeyChar != Convert.ToChar(8)) { e.Handled = true; } } }
private void txtAba1Email_KeyPress(object sender, KeyPressEventArgs e) { //Aciona o botão Laranja var newstate = Symbol.Keyboard.KeyStates.KEYSTATE_UNSHIFT; Symbol.Keyboard.KeyPad teste = new Symbol.Keyboard.KeyPad(); teste.SetKeyState(newstate, 0, true); if (e.KeyChar == Convert.ToChar('*')) { if (txtAba1Email.Text.Contains(".com")) { txtAba1Email.Text = txtAba1Email.Text + ".br"; } else { txtAba1Email.Text = txtAba1Email.Text + ".com"; } txtAba1Email.SelectionStart = txtAba1Email.Text.Length; e.Handled = true; return; } else { if (e.KeyChar == Convert.ToChar(',')) { txtAba1Email.Text = txtAba1Email.Text + "@"; txtAba1Email.SelectionStart = txtAba1Email.Text.Length; e.Handled = true; return; } } }
private void Numero_GotFocus(object sender, EventArgs e) { //Aciona o botão Laranja var newstate = Symbol.Keyboard.KeyStates.KEYSTATE_NUMERIC_LOCK; Symbol.Keyboard.KeyPad teste = new Symbol.Keyboard.KeyPad(); teste.SetKeyState(newstate, 0, true); }
private void Texto_GotFocus(object sender, EventArgs e) { //Aciona o botão Laranja var newstate = Symbol.Keyboard.KeyStates.KEYSTATE_UNSHIFT; Symbol.Keyboard.KeyPad teste = new Symbol.Keyboard.KeyPad(); teste.SetKeyState(newstate, 0, true); }
private void cmbAba5Sub5Sub3Funeral_GotFocus(object sender, EventArgs e) { var newstate = Symbol.Keyboard.KeyStates.KEYSTATE_UNSHIFT; Symbol.Keyboard.KeyPad teclado = new Symbol.Keyboard.KeyPad(); teclado.SetKeyState(newstate, 0, true); //TextoCmbAba5Sub5Sub3Funeral = string.Empty; }
private void cmbAba5Sub5Sub4Valor_GotFocus(object sender, EventArgs e) { var newstate = Symbol.Keyboard.KeyStates.KEYSTATE_NUMERIC_LOCK; Symbol.Keyboard.KeyPad teclado = new Symbol.Keyboard.KeyPad(); teclado.SetKeyState(newstate, 0, true); TextoCmbAba5Sub5Sub4Valor = string.Empty; }
private void cmbAba1ConjugeProfissao_GotFocus(object sender, EventArgs e) { var newstate = Symbol.Keyboard.KeyStates.KEYSTATE_UNSHIFT; Symbol.Keyboard.KeyPad teclado = new Symbol.Keyboard.KeyPad(); teclado.SetKeyState(newstate, 0, true); TextoCmbAba1Profissao = string.Empty; }
private void Telefone_KeyPress(object sender, KeyPressEventArgs e) { char digitoSaida = '0'; bool verificado = false; //Aciona o botão Laranja var newstate = Symbol.Keyboard.KeyStates.KEYSTATE_NUMERIC_LOCK; Symbol.Keyboard.KeyPad teclado = new Symbol.Keyboard.KeyPad(); teclado.SetKeyState(newstate, 0, true); if (((TextBox)sender).Text.Length == 15 && e.KeyChar != Convert.ToChar(8)) { e.Handled = true; return; } verificado = new Util.Mask().ApenasNumero(e.KeyChar, ref digitoSaida); if (verificado) { if ((txtAba3Telefone.Focused && ((TextBox)sender).Text.Length < 13) || (txtAba3Celular.Focused && ((TextBox)sender).Text.Length < 14)) { if (((TextBox)sender).Text.Length == 0) { ((TextBox)sender).Text = "(" + digitoSaida; } else if (((TextBox)sender).Text.Length == 3) { ((TextBox)sender).Text = ((TextBox)sender).Text + ")" + digitoSaida; } else if (txtAba3Telefone.Focused && ((TextBox)sender).Text.Length == 8) { ((TextBox)sender).Text = ((TextBox)sender).Text + "-" + digitoSaida; } else if (txtAba3Celular.Focused && ((TextBox)sender).Text.Length == 9) { ((TextBox)sender).Text = ((TextBox)sender).Text + "-" + digitoSaida; } else { ((TextBox)sender).Text = ((TextBox)sender).Text + digitoSaida; } ((TextBox)sender).SelectionStart = ((TextBox)sender).Text.Length; e.Handled = true; } } else { if (e.KeyChar != Convert.ToChar(8)) { e.Handled = true; } } }
private void CEP_KeyPress(object sender, KeyPressEventArgs e) { char digitoSaida = '0'; bool verificado = false; //Aciona o botão Laranja var newstate = Symbol.Keyboard.KeyStates.KEYSTATE_NUMERIC_LOCK; Symbol.Keyboard.KeyPad teclado = new Symbol.Keyboard.KeyPad(); teclado.SetKeyState(newstate, 0, true); if (e.KeyChar == Convert.ToChar(8)) { return; } if (((TextBox)sender).Name.Equals("txtAba4CEPbox1") && txtAba4CEPbox1.Text.Length == 5) { e.Handled = true; return; } if (((TextBox)sender).Name.Equals("txtAba4CEPbox1") && txtAba4CEPbox1.Text.Length == 4) { verificado = new Util.Mask().ApenasNumero(e.KeyChar, ref digitoSaida); if (verificado) { ((TextBox)sender).Text = ((TextBox)sender).Text + digitoSaida; ((TextBox)sender).SelectionStart = ((TextBox)sender).Text.Length; e.Handled = true; } txtAba4CEPbox2.Focus(); return; } if (((TextBox)sender).Name.Equals("txtAba4CEPbox2") && txtAba4CEPbox2.Text.Length == 3) { e.Handled = true; return; } verificado = new Util.Mask().ApenasNumero(e.KeyChar, ref digitoSaida); if (verificado) { ((TextBox)sender).Text = ((TextBox)sender).Text + digitoSaida; ((TextBox)sender).SelectionStart = ((TextBox)sender).Text.Length; e.Handled = true; } else { e.Handled = true; } }
private void Numero_GotFocus(object sender, EventArgs e) { try { //Aciona o botão Laranja var newstate = Symbol.Keyboard.KeyStates.KEYSTATE_NUMERIC_LOCK; Symbol.Keyboard.KeyPad teclado = new Symbol.Keyboard.KeyPad(); teclado.SetKeyState(newstate, 0, true); } catch (Exception ex) { LogErro.GravaLog("Erro ao Texto_GotFocus do feedback.", ex.Message); } }
private void txtAba4Complemento_GotFocus(object sender, EventArgs e) { if (cmbAba4Complemento.SelectedValue.Equals("Apto")) { var newstate = Symbol.Keyboard.KeyStates.KEYSTATE_NUMERIC_LOCK; Symbol.Keyboard.KeyPad teclado = new Symbol.Keyboard.KeyPad(); teclado.SetKeyState(newstate, 0, true); } else { var newstate = Symbol.Keyboard.KeyStates.KEYSTATE_UNSHIFT; Symbol.Keyboard.KeyPad teclado = new Symbol.Keyboard.KeyPad(); teclado.SetKeyState(newstate, 0, true); } }
private void CEP_KeyPress(object sender, KeyPressEventArgs e) { char digitoSaida = '0'; bool verificado = false; //Aciona o botão Laranja var newstate = Symbol.Keyboard.KeyStates.KEYSTATE_NUMERIC_LOCK; Symbol.Keyboard.KeyPad teste = new Symbol.Keyboard.KeyPad(); teste.SetKeyState(newstate, 0, true); if (((TextBox)sender).Name.Equals("txtAba2CEPbox1") && txtAba2CEPbox1.Text.Length == 5 && e.KeyChar != Convert.ToChar(8)) { e.Handled = true; return; } if (((TextBox)sender).Name.Equals("txtAba2CEPbox2") && txtAba2CEPbox2.Text.Length == 3 && e.KeyChar != Convert.ToChar(8)) { e.Handled = true; return; } verificado = new Util.Mask().ApenasNumero(e.KeyChar, ref digitoSaida); if (verificado) { ((TextBox)sender).Text = ((TextBox)sender).Text + digitoSaida; ((TextBox)sender).SelectionStart = ((TextBox)sender).Text.Length; e.Handled = true; } else { if (e.KeyChar != Convert.ToChar(8)) { e.Handled = true; } } int tamanho = txtAba2CEPbox1.Text.Length + txtAba2CEPbox2.Text.Length; if (tamanho == 8) { Util.MostraCursor.CursorAguarde(true); PesquisarCEP(txtAba2CEPbox1.Text + txtAba2CEPbox2.Text); Util.MostraCursor.CursorAguarde(false); } }
private void CPF_KeyPress(object sender, KeyPressEventArgs e) { char digitoSaida = '0'; bool verificado = false; //Aciona o botão Laranja var newstate = Symbol.Keyboard.KeyStates.KEYSTATE_NUMERIC_LOCK; Symbol.Keyboard.KeyPad teste = new Symbol.Keyboard.KeyPad(); teste.SetKeyState(newstate, 0, true); if (((TextBox)sender).Text.Length == 14 && e.KeyChar != Convert.ToChar(8)) { e.Handled = true; return; } verificado = UtilMask.ApenasNumero(e.KeyChar, ref digitoSaida); if (verificado) { if (((TextBox)sender).Text.Length == 3) { ((TextBox)sender).Text = ((TextBox)sender).Text + "." + digitoSaida; } else if (((TextBox)sender).Text.Length == 7) { ((TextBox)sender).Text = ((TextBox)sender).Text + "." + digitoSaida; } else if (((TextBox)sender).Text.Length == 11) { ((TextBox)sender).Text = ((TextBox)sender).Text + "-" + digitoSaida; } else { ((TextBox)sender).Text = ((TextBox)sender).Text + digitoSaida; } ((TextBox)sender).SelectionStart = ((TextBox)sender).Text.Length; if (((TextBox)sender).Text.Length == 14) { string cpfsonumero = ((TextBox)sender).Text.Replace('.', ' ').Replace('-', ' ').Trim(); if (UtilValidacoes.isCPF(cpfsonumero)) { cmbAba1Sexo.Focus(); } else { CaixaMensagem.ExibirOk("Campo CPF inválido!"); txtAba1CPF.Focus(); } } e.Handled = true; } else { if (e.KeyChar != Convert.ToChar(8)) { e.Handled = true; } } }