Exemple #1
0
 private void txtFilmLength_Validating(object sender, CancelEventArgs e)
 {
     if (txtFilmLength.Text != "")
     {
         if (VoucherBatchManage.IsIntegerNumber(txtFilmLength.Text) == false)
         {
             MessageBox.Show("片长请输入整数", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             //txtFilmLength.Clear();
             //txtFilmLength.DataBindings.Clear();
             //txtFilmLength.DataBindings.Add("Text", dataBindingSource, "FilmLength", true);
             //txtFilmLength.Focus();
             return;
         }
     }
     else
     {
         MessageBox.Show("请输入符合的数字", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
         txtFilmLength.Focus();
         return;
     }
 }
Exemple #2
0
 private void txtLevels_Validating(object sender, CancelEventArgs e)
 {
     if (txtLevels.Text != "")
     {
         txtLevels.Text = txtLevels.Text.Replace("层", string.Empty);
         if (VoucherBatchManage.IsIntegerNumber(txtLevels.Text) == false)
         {
             MessageBox.Show("请输入整数", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             txtLevels.DataBindings.Clear();
             txtLevels.DataBindings.Add("Text", dataBindingSource, "Levels", true);
             txtLevels.DataBindings["Text"].Format += TextBox_Currency_Format1;
             txtLevels.DataBindings["Text"].Parse  += TextBox_Currency_Parse1;
             txtLevels.Clear();
             txtLevels.Focus();
             return;
         }
     }
     else
     {
         MessageBox.Show("请输入符合的数字", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
         txtLevels.Focus();
         return;
     }
 }