I
Imran Hayat
Hello! I'm trying to create a control (inheriting from
the Textbox) that will allow the user's entered text to
be reformatted when the user leaves the control. I plan
to use this control to allow the user to enter things
such as a telephone number or postal code, etc. and
specify to the control what the input'ed text should be
re-formatted into.
So if the user enters 3334842989 and leaves the textbox,
it should automatically reformat the entered text into:
(333) 484-2989.
Could someone point me in the right direction as to how I
can do this? I already have a control like this for
datetime values, and that is easy because I just specify
to the control the formatting expression to pass to the
DateTime.tostring(format) mathod to re-format the entered-
in value. Now I just need to do this for a string based
input variable.
Thanks in advance!
the Textbox) that will allow the user's entered text to
be reformatted when the user leaves the control. I plan
to use this control to allow the user to enter things
such as a telephone number or postal code, etc. and
specify to the control what the input'ed text should be
re-formatted into.
So if the user enters 3334842989 and leaves the textbox,
it should automatically reformat the entered text into:
(333) 484-2989.
Could someone point me in the right direction as to how I
can do this? I already have a control like this for
datetime values, and that is easy because I just specify
to the control the formatting expression to pass to the
DateTime.tostring(format) mathod to re-format the entered-
in value. Now I just need to do this for a string based
input variable.
Thanks in advance!