Seperate certain items from an array?

Joined
Jun 23, 2006
Messages
14
Programming Experience
1-3
Hi,
I am making an application where I want to provide an autocomplete listbox, so if the user types "ab", it will show all strings in my array that start with "ab". I know how to find the first item in an array that begins with a string, but how can I seperate all strings beginning with "ab" into a seperate array?
Thanks.
 
tbh.. i'd use a datatable with a single column, put on top of that a dataview, and set the listbox datasource to be the dataview

when the user types something, set the .Filter of the dataview


why do this?
because it uses code that microsoft wrote (and their code ought to be pretty good - its in their interest to make it perform)
because it unclutters your code (setting the filter takes 1 line of code)
because its a wheel that has already been invented
 
ps; conor - do you realise how much spam you open yourself up to, by using your email address as a forum username? Your mail address is now on potentially many web pages that the spam robots can read, put in their databases and send junk to.. its kinda like striving to be the chicken with the longest neck on the farm.. (the forum goes to great lengths to hide your email from spammers)
 
Back
Top