示例#1
0
 private void ResTxt3_KeyPress(object sender, KeyPressEventArgs e)
 {
     resultLbl.Text = null;
     if (e.KeyChar == (char)13 && ResTxt2.Text != null)
     {
         if (GetResult(ResTxt1.Text, ResTxt2.Text, ResTxt3.Text, ResTxt4.Text))
         {
             RightFun();
         }
         else
         {
             ErrorFun();
         }
     }
     else if (e.KeyChar < 48 || e.KeyChar > 57)
     {
         e.KeyChar      = (char)0;
         resultLbl.Text = "введите цифру";
         ResTxt3.Focus();
     }
     else if (e.KeyChar > 47 && e.KeyChar < 58)
     {
         ResTxt4.Focus();
     }
 }
示例#2
0
 private void ResTxt4_Click(object sender, EventArgs e)
 {
     ResTxt4.Clear();
 }