simple formatting question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am a newbie and embarrassed to ask the following. I have a textbox in
which the telephone number goes. I want the user to just type in the numbers
and on leaving, it formats to (000) 000-0000 style. I've got it all with the
exception of how do you get it into that style with Leave? I said it was
embarrassing.
*** John
 
If for sure, the user will enter a 10 digit number, then one way to format
it is;

String.Format("{0:(000) 000-0000}", Int64.Parse(TextBox.Text))

I am a newbie and embarrassed to ask the following. I have a textbox in
which the telephone number goes. I want the user to just type in the
numbers
and on leaving, it formats to (000) 000-0000 style. I've got it all with
the
exception of how do you get it into that style with Leave? I said it was
embarrassing.
*** John
 
Back
Top