Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB 2005 Masked Text Box IP Address

Posted on 2006-10-30
4
Medium Priority
?
2,637 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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses
Course of the Month13 days, 11 hours left to enroll

963 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