How to create an Autocomplete Textbox????

zorzos

New member
Joined
Aug 10, 2004
Messages
4
Programming Experience
1-3
[font=verdana, arial, helvetica]Hi!
I am trying to figure out how to code for an Autocomplete Textbox
in VB.NET!

All i want to do is :
1. When a user types in the textbox, a "select" statement starts to bring data in a dataview, where i keep all the information that i want, from a database.
2. While he types, and the "select" statement finds a record that begins with the characters typed, i want the textbox to be filled with this record and to select only the remaining characters that filled the textbox.
3. Also i want the pointer in the textbox to remain in the typing position and not at the end.

As you probably understood, i want to do exactly what Microsoft Excel does when you type similar words or phrases.

Please , urgent help!!!!
Thanx in advance!!!!!!!!!!
[/font]
 

EdAlaska

Member
Joined
Aug 11, 2004
Messages
9
Programming Experience
10+
auto complete

This is a nice feature that MS has for its Office products, but, a lot of users find it to a PITA. First of all, you can do the select but if there are multiple copies of the same word or phrase, which one do you select - by default its the first occurance - but then your program has to "remember" where it stopped to continue when the user types the next letter? or, is the select going to be done as a distinct query? Secondly, a number of users find it annoying that MS fills items in for you only to force you to highlight and retype what they tried to help you with because it was the wrong word or phrase. The autocomplete features works a lot nicer and friendlier on a list box or combo box. There you can open the list and "jump" to the first occurance of the typed letters giving the user the option of selecting from the list or continuing to type.

my .02
Ed.
 

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
I am a user that likes the autoComplete function of textBoxs, like some webSites use. There are several exaples of WinForm textBox controls that implement the autoComplete functionality. Right now I can only find a C# example, but it can be used in a VB.NET project or ported to VB.NET. Here's the link: Autocomplete Textbox Control
 
Top Bottom