Click here to Skip to main content
12,550,623 members (32,044 online)
Click here to Skip to main content
Add your own
alternative version


30 bookmarked

Textbox Which Holds an IP Address

, 18 Aug 2008 CPOL
Rate this:
Please Sign up or sign in to vote.
This is a control which represents a single IP Address


This control mimics the standard IP Address textbox you see in Windows. It has four sections, separated by a period, each of which contains numbers which are >= 0 and <= 255.


Nothing too amazing, I just got sick of users always messing up when entering an IP Address. I didn't see anything out there using the 'new' Masktextbox control that comes with .NET, so I thought I'd throw something together to help 'em out.

Using the Code

This is extremely simple. Get and Set the text as you normally would (pass it "" and you'll get the same thing back, even if it is displayed differently). Use it as you would normally use a control.

To add this to your project, either copy the source, or add a reference to the DLL. The namespace is DEMO.

Points of Interest

It'd be interesting to use regular expressions instead, go for it!


This is pretty basic. If you make any changes/add features that you think are useful, feel free to forward them on to me - Enjoy!


  • 31st January, 2008: Initial post
  • 18th August, 2008: Updated source


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

United States United States
No Biography provided

You may also be interested in...


Comments and Discussions

GeneralMy vote of 1 Pin
VasDmi66623-Jan-12 9:35
memberVasDmi66623-Jan-12 9:35 
GeneralResizing Pin
Jeroenh18-Aug-08 22:34
memberJeroenh18-Aug-08 22:34 
QuestionScreenshot? Pin
Johnny J.18-Aug-08 21:46
memberJohnny J.18-Aug-08 21:46 
GeneralUseful Pin
Angelo Cresta1-Feb-08 3:55
memberAngelo Cresta1-Feb-08 3:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161021.1 | Last Updated 18 Aug 2008
Article Copyright 2008 by jkatebin
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid