Пример #1
0
 private void tbPrice_KeyDown(object sender, KeyEventArgs e)
 {
     e.SuppressKeyPress = true;
     if (InputKey.ValidNumberKey(e))
     {
         e.SuppressKeyPress = false;
     }
     else if (InputKey.IsDecimalPoint(e))
     {
         if (!TextBoxInput.ContainsDecimalPoint(tbPrice) ||
             TextBoxInput.AllTextSelected(tbPrice) ||
             TextBoxInput.SelectionContainsDecimalPoint(tbPrice))
         {
             e.SuppressKeyPress = false;
         }
     }
 }