MaskedEditBox

ggootee

Newcomer
Joined
Dec 14, 2002
Messages
14
I am writing a program in which I need to use , or I would like to use, the maskeditbox. However, even after making sure I have the reference for it. I want to change the backcolor as a person moves into the field and have some that are required that I want to change to Red if the user tries to submit data with out filling them out. I have even tried the default in the properties which changes it in design view but when ran stays white. Does anyone have any ideas. I have two needs. One is that I really wanted to have the Social Security Number look like ###-##-#### and the other fields are currency fields which I would like to have $###,###,###.00. I have been playing with the format command but will have to write a ton of code to convert from a string and back again. Help anyone...
 
Cont...

Hi, I added it through the com reference using VB6 interop. Is there another way to do the same thing in .net that I should be doing? In VB 6 I had it set that when a user entered 500 in a field as soon as they left the maskedit would change it to look like $500.00 any ideas on how to do this in .net thanks
 
You should not be using COM in .NET unless you absolutely have to. Instead, use a TextBox's Validating event, checking for the proper format using .NET's built in Regular Expressions and the basic string and currency functions.
 
Back
Top