if Not ( ( Key >= widechar('А') and (Key <= widechar('Я')) or ( Key >= widechar('а') and (Key <= widechar('я')) or ( Key >= widechar('0') and (Key <= widechar('9')) or ( Key = widechar(#8)) ) then Key:=#0;