MaskedTextBox input mask for 1-AA000

  • Thread starter Thread starter sklett
  • Start date Start date
S

sklett

Hi,

I'm trying to define a mask for a MaskedTextBox and can't get it right. For
5 numbers, '00000' seems to be a valid mask and behaves correctly, but I
know need a control that will take a format like this: '0-AA000'
Where 0 can be anything from 0-9 and A can be any letter.

I tried '#-??###' but this mask doesn't work as the control states that it's
mask is completed after the first number is entered.

I checked MSDN but the documentation is VERy light and all the samples I've
found or only numbers.

Am I trying to make this control do something it wasn't intended for?

Thanks for reading,
Steve
 
sklett said:
Hi,

I'm trying to define a mask for a MaskedTextBox and can't get it right. For
5 numbers, '00000' seems to be a valid mask and behaves correctly, but I
know need a control that will take a format like this: '0-AA000'
Where 0 can be anything from 0-9 and A can be any letter.

I tried '#-??###' but this mask doesn't work as the control states that it's
mask is completed after the first number is entered.

I checked MSDN but the documentation is VERy light and all the samples I've
found or only numbers.

Am I trying to make this control do something it wasn't intended for?

Thanks for reading,
Steve
Try 0-??000 as # is an optional number and 0 is a required number.
Also presuming that ? is the character for A-Z.
JB
 
John B said:
Try 0-??000 as # is an optional number and 0 is a required number.
Also presuming that ? is the character for A-Z.
JB

That did it, thanks for the help.
Have a good one,
Steve
 
Back
Top