By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,483 Members | 3,312 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,483 IT Pros & Developers. It's quick & easy.

Textbox auto-complete feature

P: n/a
Hi,

I am developing an application using VB.Net and hope that the textbox can
process features which are similar to auto-complete features in Window. For
example, when user types "ap" in a textbox and the data associated to the
textbox contains ("apple", "applet", "application"......), the application
will suggest "apple" to the user to select and user can either select the
suggestion or continue to type another word he disires.

How to achieve this features?

Thanks for your help and attention.

Rgs,
John
Nov 21 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
John,

If you mean in a windows form and a historical set of words used in your
program, than it will be in my opinion the most easy using the regisistry
and the keyUp event from the textbox.

If it is a set of words general used in your organisation than you will have
to read it first from a database or have it fixed as words in your program.

Just as idea

Cor

"John" <Jo**@discussions.microsoft.com> schreef in bericht
news:A4**********************************@microsof t.com...
Hi,

I am developing an application using VB.Net and hope that the textbox
can
process features which are similar to auto-complete features in Window.
For
example, when user types "ap" in a textbox and the data associated to the
textbox contains ("apple", "applet", "application"......), the application
will suggest "apple" to the user to select and user can either select the
suggestion or continue to type another word he disires.

How to achieve this features?

Thanks for your help and attention.

Rgs,
John

Nov 21 '05 #2

P: n/a
Hi,

In addition to Cor's comments vb.net 2005 has an autocomplete
feature.

http://msdn2.microsoft.com/en-us/library/chff42zw

http://msdn2.microsoft.com/en-us/library/aehe18z8

Ken
---------------------
"John" <Jo**@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
Hi,

I am developing an application using VB.Net and hope that the textbox
can
process features which are similar to auto-complete features in Window.
For
example, when user types "ap" in a textbox and the data associated to the
textbox contains ("apple", "applet", "application"......), the application
will suggest "apple" to the user to select and user can either select the
suggestion or continue to type another word he disires.

How to achieve this features?

Thanks for your help and attention.

Rgs,
John

Nov 21 '05 #3

P: n/a
If you're interested in a commercial solution contact me offline.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"John" <Jo**@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
Hi,

I am developing an application using VB.Net and hope that the textbox
can
process features which are similar to auto-complete features in Window.
For
example, when user types "ap" in a textbox and the data associated to the
textbox contains ("apple", "applet", "application"......), the application
will suggest "apple" to the user to select and user can either select the
suggestion or continue to type another word he disires.

How to achieve this features?

Thanks for your help and attention.

Rgs,
John

Nov 21 '05 #4

P: n/a
Dear Ken,

Thanks. But I am currently using 2003 and not yet ready to migrate to
2005.

Thanks for your information.

Rgs,
John

"Ken Tucker [MVP]" wrote:
Hi,

In addition to Cor's comments vb.net 2005 has an autocomplete
feature.

http://msdn2.microsoft.com/en-us/library/chff42zw

http://msdn2.microsoft.com/en-us/library/aehe18z8

Ken
---------------------
"John" <Jo**@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
Hi,

I am developing an application using VB.Net and hope that the textbox
can
process features which are similar to auto-complete features in Window.
For
example, when user types "ap" in a textbox and the data associated to the
textbox contains ("apple", "applet", "application"......), the application
will suggest "apple" to the user to select and user can either select the
suggestion or continue to type another word he disires.

How to achieve this features?

Thanks for your help and attention.

Rgs,
John


Nov 21 '05 #5

P: n/a
Dear Cor,

Thanks for your idea. But I need a bit more details. According to your
reply, I will retrieve the "values" from database during the FormLoad events.
Then when user types in the text box, I will place code in the KeyUp event
to pick up values according to user's types in. But what to do to display
the value? There are two approaches for me to consider but I have problem to
achieve it.

1.) Display a list of values for user to select. The interface will look
like displaying a Context Menu but Context menu requires a mouse pointing to
that field and then Right Click the field. However, in my case, there will
not be any mouse over event as well as right lick events. There are only a
series of keypress or keyup events. Is there any Controls and Events which
can achieve this things?

2.) Display a value for user to complete the field. It is exactly the
case that when you are typing "Sat" in MS Word, Word will display "Saturday"
in a tool tip text box nearby where you type. If that is what user wants to
type, user just press <Enter> to get the value. But What Events and Controls
in VB.Net is required to achieve this effect? I have tried ToolTip controls
but this control requires Mouse Over events.

Thanks for your suggestion

Rgs,
John

"Cor Ligthert [MVP]" wrote:
John,

If you mean in a windows form and a historical set of words used in your
program, than it will be in my opinion the most easy using the regisistry
and the keyUp event from the textbox.

If it is a set of words general used in your organisation than you will have
to read it first from a database or have it fixed as words in your program.

Just as idea

Cor

"John" <Jo**@discussions.microsoft.com> schreef in bericht
news:A4**********************************@microsof t.com...
Hi,

I am developing an application using VB.Net and hope that the textbox
can
process features which are similar to auto-complete features in Window.
For
example, when user types "ap" in a textbox and the data associated to the
textbox contains ("apple", "applet", "application"......), the application
will suggest "apple" to the user to select and user can either select the
suggestion or continue to type another word he disires.

How to achieve this features?

Thanks for your help and attention.

Rgs,
John


Nov 21 '05 #6

P: n/a
John,

You make it yourself very difficult by using a textbox. The combobox and
listbox have both a findstring method. That is especially for this kind of
operations. I have made myself a combobox autocomplete sample, however that
is for a very special one. If you search Google for combobox autocomplete
you find tons of those.

http://groups.google.com/group/micro...1d7cb3c?hl=en&

In the way you want it with a textbox, you will need to find that string
everytime, for what I will think that only a datatable.select will fit

http://msdn.microsoft.com/library/de...electtopic.asp

I hope this helps something.

Cor
Nov 21 '05 #7

P: n/a
Dear Cor,

Thanks for your reply and sorry for my late reply because I have to
investigate some API of Fax Automation for the system as well. I hope you
can notice this mail and give me some idea.

I have just retried the ComboBox as you have told me about and I know
that Combo is close to what I need because it can type in value and choose
value. Unfortunately, I cannot make what my Mgr wants exactly. So, let me
explain in details. Maybe you have work-around method on Combo Box that can
achieve my Mgr requirement.

In the application, there are some free format fields like job title of
our customer. I cannot predefine these fields because they vary much.
However, my Mgr hopes that I can create a field (not a must to be a textbox)
that can achieve the following 2 cases.

1) when user has to type in a value that exists before, the field can auto
fill / suggest the value. For example, the database contains "Analyst
Programmer" and user has typed "analyst programmer", the application will
automatically fill / suggest "Analyst Programmer". This feature helps to
reduce typing mistake.

2) when user has to type in a value that is not exists before but similar,
the system will suggest / fill the value but user can override with his
actual value. For example, the database has "assistant manager" but the user
wants to enter "Assistant Supervisor".

Thanks for your help so far and I hope the above description let you
understand more on my situation and you can suggest some good ideas for me.

Thank you very much.

Rgs,
John

"Cor Ligthert [MVP]" wrote:
John,

You make it yourself very difficult by using a textbox. The combobox and
listbox have both a findstring method. That is especially for this kind of
operations. I have made myself a combobox autocomplete sample, however that
is for a very special one. If you search Google for combobox autocomplete
you find tons of those.

http://groups.google.com/group/micro...1d7cb3c?hl=en&

In the way you want it with a textbox, you will need to find that string
everytime, for what I will think that only a datatable.select will fit

http://msdn.microsoft.com/library/de...electtopic.asp

I hope this helps something.

Cor

Nov 21 '05 #8

P: n/a
John,

This is in my idea recognizing a word and than get the most possible
equivalent. In my opinion is this more a natural language problem than a
program language problem. To find the equivalents in a table when you know
those (even with wildcards) is probably as well for you no problem. However
creating that table, that will be the problem especially for most developers
which are not always the best in natural languages.

Maybe can *speech* help you (I have no experience with that), otherwise I
would tell to your manager something the same as I wrote above and ask him
if he is able to create that table for you.

I hope this helps.

Cor
Nov 21 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.