ggootee Posted December 14, 2002 Posted December 14, 2002 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... Quote
*Gurus* Derek Stone Posted December 14, 2002 *Gurus* Posted December 14, 2002 I'm really lost as to your mentioning of MaskedEditBox, since there isn't one in .NET. Are you using a third party control? Inheriting from the base TextBox class? Quote Posting Guidelines
ggootee Posted December 14, 2002 Author Posted December 14, 2002 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 Quote
*Gurus* Derek Stone Posted December 14, 2002 *Gurus* Posted December 14, 2002 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. Quote Posting Guidelines
ggootee Posted December 16, 2002 Author Posted December 16, 2002 Hi I made the changes like you suggested and it works good. Thanks for the hlep Greg Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.