コード例 #1
0
 private void txtVH_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == ',')
     {
         e.KeyChar = Testes.soumaVirgula(txtVH.Text);
     }
     e.KeyChar = Testes.consistNum(e.KeyChar);
 }
コード例 #2
0
 private void txtHT_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (txtNome.Text.Trim() == "")
     {
         MessageBox.Show("Preencha o nome do funcionário.");
         txtNome.Focus();
     }
     if (e.KeyChar == ',')
     {
         e.KeyChar = Testes.soumaVirgula(txtHT.Text);
     }
     e.KeyChar = Testes.consistNum(e.KeyChar);
 }