daily pastebin goal
1%
SHARE
TWEET

Работа с "TextBox" C#

the_alex_mark Mar 24th, 2019 (edited) 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Запрет ввода текста с клавиатуры
  2. textBox1.KeyPress += delegate (Object _object, EventArgs _eventArgs)
  3. {
  4.     a.Handled = true;
  5. };
  6.  
  7. // Ввод только русских букв, точки и нажатия "backspace".
  8. textBox1.KeyPress += delegate (Object _object, EventArgs _eventArgs)
  9. {
  10.     char l = e.KeyChar;
  11.     if ((e.KeyChar < 'А' || e.KeyChar > 'я') && e.KeyChar != '\b' && e.KeyChar != '.')
  12.     {
  13.         e.Handled = true;
  14.     }
  15. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top