473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Limit ComboBox entry to ipaddress format

I would like to allow a user to enter an ip address (quad octet format:
www.xxx.yyy.zzz) in a combo box and then add it to the list when they
have completed the entry.

How can I do this?

The textupdate and textchanged events fire for each keystroke so I
don't think that is the solution. I was hoping there was an event
which would fire when they completed text entry and hit enter or the
hit the down arrow but no such luck. I can watch the lost focus event
and check then but I think there is a better solution.

Thanks for your help.

Jun 20 '06 #1
3 3190
You can always check the length of the text in the combobox. when it is
15 (including the dots) then you do your validation. Or you can handle
keyup event and check if the pressed key is enter then do your
validation.

Let me know if that solves your issue.

Cheers,
Ahmed

nt*******@sneakemail.com wrote:
I would like to allow a user to enter an ip address (quad octet format:
www.xxx.yyy.zzz) in a combo box and then add it to the list when they
have completed the entry.

How can I do this?

The textupdate and textchanged events fire for each keystroke so I
don't think that is the solution. I was hoping there was an event
which would fire when they completed text entry and hit enter or the
hit the down arrow but no such luck. I can watch the lost focus event
and check then but I think there is a better solution.

Thanks for your help.


Jun 20 '06 #2

Ahmed wrote:
You can always check the length of the text in the combobox. when it is
15 (including the dots) then you do your validation. Or you can handle
keyup event and check if the pressed key is enter then do your
validation.


Thanks for you reply.

I think that is a good start. However, what about 10.0.0.1, 10.0.0.10,
and 10.0.0.100?

Thanks.

Jun 20 '06 #3
Are you using .NET 2.0 or 1.1? if you are using 2.0, you can use the
masked Textbox. If you want a drop down what you can do is to have the
masked textbox. Take a look at this site:
http://msdn2.microsoft.com/en-us/library/ka7h9fze.aspx

or you can validate the ip address when the user press on enter.

nt*******@sneakemail.com wrote:
Ahmed wrote:
You can always check the length of the text in the combobox. when it is
15 (including the dots) then you do your validation. Or you can handle
keyup event and check if the pressed key is enter then do your
validation.


Thanks for you reply.

I think that is a good start. However, what about 10.0.0.1, 10.0.0.10,
and 10.0.0.100?

Thanks.


Jun 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Nancy | last post by:
I have two tables: TblCourse CourseID CourseName TblClass ClassID CourseID ClassDate
2
by: Stefan Richter | last post by:
How can I dynamically select a ComboBox Entry? Could you please provide some sample code? Thanks in advance!!! Stefan
10
by: Tosch | last post by:
I have a combobox where a user can select a zoom factor or enter a zoom factor. I tried to limit entry into the combobox to numbers only by catching the keydown event and setting e.handled = true...
17
by: ApexData | last post by:
Hello I have a single form, and want to require the user to make a selection from a serialnumber ComboBox before being allowed to enter any other textboxes. Also, the user should be allowed to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.