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 "192.168.0.100" 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
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 - email@example.com. Enjoy!
- 31st January, 2008: Initial post
- 18th August, 2008: Updated source