Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2004

Tip: Looking for answers? Try searching our database.

Formatting txtPhone

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave - 17 Oct 2004 00:49 GMT
I have a txtPhone that I need to format like 555-555-5555 and when a user
inputs numbers it should only take numbers.
Sooraj PM - 17 Oct 2004 07:21 GMT
Hi

You mean the text box should display the characters like that? If yes, You
can use the ToString method by giving txtPhone.Text =
MyPhoneNumber.ToString("###-###-####"). While saving replace the "-"
character with null.

Sooraj
Microsoft Community Star

> I have a txtPhone that I need to format like 555-555-5555 and when a user
> inputs numbers it should only take numbers.
Dave - 17 Oct 2004 22:55 GMT
How do I do that?

> Hi
>
[quoted text clipped - 8 lines]
> > I have a txtPhone that I need to format like 555-555-5555 and when a user
> > inputs numbers it should only take numbers.
Herfried K. Wagner [MVP] - 17 Oct 2004 11:58 GMT
"Dave" <Dave@discussions.microsoft.com> schrieb:
> I have a txtPhone that I need to format like 555-555-5555
> and when a user inputs numbers it should only take numbers.

<URL:http://www.codeproject.com/cs/miscctrl/maskedcsedit.asp>
<URL:http://www.codeproject.com/vb/net/maskedbox_control.asp>
<URL:http://www.codeproject.com/vb/net/validtext3.asp>
<URL:http://www.codeproject.com/vb/net/cpflexmaskeditbox.asp>
<URL:http://www.codeproject.com/useritems/ValidText.asp>
...

.NET 2.0 will include a masked edit control.

Signature

Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.