Mask in a TextBox

  • Thread starter Thread starter Alberto
  • Start date Start date
Alberto,

You can't do this with the TextBox now. However, .NET 2.0 will
introduce a MaskedTextBox control which you can use.

For .NET 1.1, you will have to create a textbox and hook into the change
events to determine whether or not the text matches the mask.

Hope this helps.
 
You might want to look at DataBinding too. Combining the Format and Parse
events can allow a flexibility to the behaviour of a TextBox. Ex: You can
easily add a dollar sign to the display of a float to make it a currency
using Format.

And you should be able to use the parse event to control what is actually
stored in your bound class.

gdbj
 
Back
Top