Filling a masked edit box

wdw

Freshman
Joined
Dec 11, 2002
Messages
37
Hello,

I've got a masked edit box with this mask "##-##-####"
it's a date field. Now i want to fill it from the database but i don't know how. I am able to get the date from the database but i cannot bind the date to the masked editbox.

Can someone give me a solution for my problem.

thanks
 
You'll have to use the textbox's Parse and Format events to convert the date into your mask's format. Look in the help for either of these events - they have sample on converting Currency to String and back (I think).

Also, you may want to avoid the maskedit box as it's not a real .NET control. Check out divil's tutorial on how to use regular expressions to validate a control's text.

-nerseus
 
thanks for your reply,
I solved my problem by using te datetimepicker.
I was trying to avoid it but it was just the best solution.
 
Back
Top