473,321 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

simple formatting question

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
Jul 21 '05 #1
1 1086
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))

"JohnE" <Jo***@discussions.microsoft.com> wrote in message
news:8D**********************************@microsof t.com...
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
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Ot | last post by:
I posted this to the wrong group. It went to m.p.dotnet.languages.vb. Ooops. -------------------------------------------------------------------- I have this tiny problem. I have learned...
3
by: Jouke Langhout | last post by:
Hello all! For quite some time now, I've got the following problem: Access won't close properly when a user closes the application. An ACCESS process stays active and that process can only be...
2
by: Colleyville Alan | last post by:
I am using Access and have embedded the ActiveX control Formula One that came with Office 2000. (ver 3.04). I have created and formatted a spreadsheet and now I want to copy the info with...
15
by: Richard Hollenbeck | last post by:
For example, one college course has only 24 students in it, but the following code says there are zero As, 20 Bs, 16 Cs, 4 Ds, and 8 Fs. When it prints it then says 0 As, 40 Bs, 32 Cs, 8 Ds, and...
1
by: Chris | last post by:
Sorry to ask such a simple question but here it is, and I'm am new to ASP/WEB I am designing a site and I want to make it general so I can easily change the font/color/sizes of the...
3
by: The Eeediot | last post by:
How do I get a number like "131" to appear in a currency format like "$131.00" in a TextBox control? I know it's simple but I cannot find how to do this in any reference manual. TIA....
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
5
by: Burak | last post by:
Hello, I would like to format the string "11304200" into "11-3042.00". Can I do this with String.Format method? I have not come across any good documentation. Thank you,
7
by: Steven D'Aprano | last post by:
I have a sinking feeling I'm missing something really, really simple. I'm looking for a format string similar to '%.3f' except that trailing zeroes are not included. To give some examples: ...
2
by: RichB | last post by:
I am attempting to output a trace with details of the db id of a price using: Trace.WriteLine("price id(first price): {0}",evnt.Prices.Id); Wher the Id is a string. I expect from this to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.