示例#1
0
 private decimal textBoxParse(decimal input, System.Windows.Forms.TextBox source, string message)
 {
     decimal num;
     if (decimal.TryParse(source.get_Text(), ref num))
     {
         input = num;
         return input;
     }
     if (!decimal.TryParse(source.get_Text(), ref num) && (source.get_Text() != ""))
     {
         System.Windows.Forms.MessageBox.Show(message);
         input = -1M;
         return input;
     }
     input = 0M;
     return input;
 }
示例#2
0
 private void textBoxClear(System.Windows.Forms.TextBox tbName)
 {
     if (tbName.get_Text() == "0")
     {
         tbName.Clear();
     }
 }