Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I think the forum is a great idea, especially for those of us in consulting engineering. Keep up the good work!..."

Geography

Where in the world do Tek-Tips members come from?
Apata (Programmer)
13 Dec 06 19:42
Hi:

I would like to make a Combobox like Google's, using VFP 9. I want the Combobox to do the following:

1. Open up after the first character is typed, but not before, and stay open until done.

2. Do an incremental search on the string as more characters are typed.

3. Resize the width of the Combobox if length of string typed is wider.

4. Constrain the depth of the Combobox to about 10 rows when it opens up.

Thanks.

Apata
MikeLewis (Programmer)
14 Dec 06 3:55
Apata,

This is easy. Don't use a combo box. Use a textbox. Set its Autocomplete property set to 1 (or 2 to 4, depending on your tastes).

I'm not sure if that exactly mimics Google (in fact, I'm not sure what you mean by Google's combobox), but it probably comes close.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk

Apata (Programmer)
14 Dec 06 17:45
Hi, Mike. I was referring to the search combo box on the Google Toolbar.

I am trying to get the incremental search on a field containing names. How would I use your suggestion with the textbox and how would it open up with more names matching what's typed?

Thanks.
OlafDoschke (Programmer)
14 Dec 06 18:27
Apata,

open up help and learn about the autocomplete feature. Start at the Autocomplete Property of the textbox mike told you about.

Autocomplete uses a table to store already typed strings and you can make that a local table for each user or a global one, you can predefine values searchable, the table will be extended by each value typed in (if it didn't lead in a final selection of an already known item) and you're even able to define several things about how and what items are suggested by autocomplete, eg by the frequency, with which items are reused.

Would take a whole article or at least a FAQ to explain all features available.

It really fits all your needs you gave us and more.

Bye, Olaf.
OlafDoschke (Programmer)
14 Dec 06 18:37
Apata,

sorry, "all of your needs and more" is a bit misleading. You'd still need some code to resize the textbox, but that's the only feature which would normally break a form design and so isn't a basic feature of autocomplete.

You might simply adjust the width of the textbox in the interactivechange to
a) still fit the form width minus some margin pixels.
b) be at least thisform.textwidth(this.value)

Bye, Olaf.

Mike: take a look at http://labs.google.com/suggest
MikeLewis (Programmer)
15 Dec 06 3:31
Apata,

Quote:

How would I use your suggestion with the textbox and how would it open up with more names matching what's typed?

It just works. You don't have to do anything other than setting the property I mentioned.

It's true that it's not a combo. There's no arrow to click on. But you do get the drop down list which updates itself as you type.

I use this in my own search forms, and it works fine. But I also give the user the option of turning it off in case they prefer to do without it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk

mgagnon (Programmer)
20 Dec 06 5:08
Apata

Take  a look at FAQ184-1792.

It behaves almost like you want. Except it does not open up.

1. Open up after the first character is typed, but not before, and stay open until done.

It does that.

2. Do an incremental search on the string as more characters are typed.

It does that.

3. Resize the width of the Combobox if length of string typed is wider.

If the value is not in the list, it will ask you to save it.

4. Constrain the depth of the Combobox to about 10 rows when it opens up.

To limit the quantity of items displayed in the list, you need to specify the columncount to 1, the rowsourcetype to array, and set the numOfElements property to however many items you want to display.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)

badukist (Programmer)
21 Dec 06 7:50
You can use my Combobox class from UniversalThread.
It has support for asyncronous client server fetching, search in any column, search only after _incseek time elapsed (after fast type a sequence of chars )

Look for other useful downloads there

http://www.universalthread.com/wconnect/wc.dll?2,54,33,23713
Apata (Programmer)
2 Jan 07 16:01
Thanks guys! I appreciate all your help. Have been away for the Christmas and New Year break. Wishing you all a wonderful New Year!

Apata

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close