tags:

views:

26

answers:

1

I have a big application with many textbox controls (about 300-400).

I need to forbid an unicode input for all the textboxes. Is there any easy way to do that ?

C#, VS 2008, .NET 2.0


Maybe there's some global application handler or something else ?

Edit: I want to allow an input of latin alphabet symbols and digits. Chinese, japanese, and other alphabets must be prohibited.

+1  A: 

Create a custom control that encapsulates the TextBox, or simpler a class that inherits from TextBox, and in either case suppress the characters you don't want. Replace all instances of System.Windows.Forms.TextBox (and TextBox if there are any) with YourCustomClassName.

Will A
Yes, it's a solution. But there are many textboxes and only 1 programmer (me). It'll take much time. Maybe I can it faster ?
nik
Faster? The whole process will take less than ten minutes. You just do a search and replace after creating your custom control.
danbystrom
danbystrom, did you do some kind of it before ?
nik
@nik: Yes, it is common practice. :-)
danbystrom
@danbystrom, ohh no, i'll try your advice :)
nik