Character Set for TextBox

  • Thread starter Thread starter Abra
  • Start date Start date
A

Abra

Hi,
I would like to allow only some pre-defined characters to be typed in a
TextBox (for example only integer numerical, or float numerical, or only
a set of letters and so on). How can this be achieved with Visual Studio
..NET 2005 (I am using C#) ? I found a PreviewKeyDown event for the
TextBox, but I dont see how to "block" the typing of certain characters.
Or is there some other way to get such a functionality ?
Thanks in advance for your help.
Abra
 
Thanks for the hint !
Some questions about the MaskedTextControl. If I choose UInt16 as
validation type, I still can input a number bigger than 65535 without
getting an InputRejected event.
If I choose Int32 (or Int16) as validation type, I cannot input negative
sign in front of number (InputReject event is fired if '-' is entered),
so that input of negative numbers is not possible.
Is there any solution for these problems ?
Is it possible over some property to force hexadecinmal input ?
Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top