formatting a textbox - question

  • Thread starter Thread starter Simon Whale
  • Start date Start date
S

Simon Whale

Hi,

is there a way within vb,net to specify the way that information is entered
into a textbox?

for example a field that requires data to be inputted as DD/MM/YYYY

i know this was possible with VB6 as you could use a masked textbox.

can somebody point me in the right direction?

Many thanks
Simon
 
for that specific example you can best use the datetimepicker in vb.net. you
will only be able to type the format you have set.
 
I think this is what you are looking for (Search for "mask" in help)

Class Name
MaskEdBox

Remarks
The Masked Edit control generally behaves as a standard text box control
with enhancements for optional masked input and formatted output. If you do
not use an input mask, the Masked Edit control behaves much like a standard
text box.
 
You could register an event listener for when the text changes, and take
some action of the entered text doesn't fit a particular format. There are
also the ErrorProvider classes that might help you. Maybe you could use
DateTimePicker instead of a TextBox?

I develop in c# so I'm not sure how those classes work in VB.
 
Back
Top