Solved

VB 2005 Masked Text Box IP Address

Posted on 2006-10-30
4
2,457 Views
Last Modified: 2008-01-09
Hi

I would like to use the MaskedTextBox control to enter and IP address.

The custom works fine for 3 digits ie 255.255.255.255 but not for less ie 10.10.0.1

Thanks

0
Comment
Question by:weight01
4 Comments
 
LVL 6

Accepted Solution

by:
yhwhlivesinme earned 500 total points
ID: 17836167
I think it's 999.999.999.999 the 9 represents an optional character, you might be able to get clever and say: 099.099.099.099 so you are requiring at least one character.  See http://www.experts-exchange.com/Databases/MS_Access/Q_20830767.html for how other people do it....sometimes it's good to seperate the four groups of characters so you can validate them seperately and then you can concatonate them later
0
 
LVL 13

Expert Comment

by:newyuppie
ID: 17836168
doesn't it work if you put MaskedTextBox1.Mask = "999-999-999-999"? sorry i haven't much experience with textbox masks but according to this link: http://msdn2.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.mask.aspx
the 9 is for an optional digit...

NY
0
 
LVL 10

Expert Comment

by:gangwisch
ID: 17836297
i found this site relating to your question asked:
http://www.vbforums.com/showthread.php?t=429940
it gives you the source for creating your own textbox into an ip address maskbox.
0
 
LVL 1

Author Comment

by:weight01
ID: 17836517
Thanks all

I think i will go for the 4 groups.

gangwisch - that code almost worked except you can enter 4 characters into the first section - thanks for your help anyway.

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now