Click here to Skip to main content
Licence CPOL
First Posted 31 Jan 2008
Views 22,715
Downloads 538
Bookmarked 29 times

Textbox Which Holds an IP Address

By | 18 Aug 2008 | Article
This is a control which represents a single IP Address

Introduction

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.

Background

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 DEMO.

Points of Interest

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

Feedback

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

History

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

License

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

About the Author

jkatebin



United States United States

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 1 PinmemberVasDmi6669:35 23 Jan '12  
GeneralResizing PinmemberJeroenh22:34 18 Aug '08  
QuestionScreenshot? PinmemberJohnny J.21:46 18 Aug '08  
GeneralUseful PinmemberAngelo Cresta3:55 1 Feb '08  

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

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

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 18 Aug 2008
Article Copyright 2008 by jkatebin
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid