Solved

VB 2005 Masked Text Box IP Address

Posted on 2006-10-30
4
2,526 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Iteration Help (Asp.net VB) 5 36
VB.net DataGridView show bit field as Text column not CheckBox column 5 29
VB.NET Inline If statement 4 39
UDP Data Capture Thread Issue 7 30
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

740 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