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
 

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

Similar Threads

C# winform masked textbox 0
Formatting a bound textbox to show currency? 3
TextBox Question 3
Masked textbox alignment? 2
TextBox Input Mask 1
About TextBox 1
C# text control 1
Masking of Text Box 1

Back
Top