[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 290
  • Last Modified:

ComboBox AutoLookup behavior

Here's what we're experienceing in a part of our app written with Delphi 6:

In a TComboBox that has many items in its list, a user can jump directly to a selected item if they type in the text of the desired item **really fast**   This typicak "auotLookup" behavior really does work, but you've gotta type quickly.  As you might guess, we have annoyed users who complain that if they pause at all while keying in the desired "jump to" text, to combobox loses track of thier request:

Example:  user wants to do an "autoLookup" of list member RL357 in the comboBox

if user types in RL357 extremely fast without pausing...the combo finds RL357 just fine
BUT
if a user types in RL, then pauses for a split second, then types 357...the combo forgets about the RL and jumps to the items in the list the begin with 357 instead.

I'm hoping the TComboBox has some "window of typing time" setting that I can adjust, but I can't find anything like that.  Are we stuck with the 'fast-typing' workaround or can the combox be altered to accomodate slower typing during autoLookup?

Thanks for  your thoughts!
0
bohiggy
Asked:
bohiggy
1 Solution
 
mikelittlewoodCommented:
I understand this is a pain bohiggy, but I personally havent found any some of time property for the autocomplete.
I hope someone has a work around for this issue as I would be interested too.
0
 
pcsentinelCommented:
Heres a solution, its not terribly elegant but it does work.

put a timer on the form

set the timer.enabled to false and the timer interval to the maximum amount of time you want your users to have between keystrokes

create a form level variable
    FTyped: string;

add this code

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Combobox1.itemindex:=Combobox1.items.indexof(FTyped);
  Timer1.enabled:=false;
  FTyped:='';
end;

procedure TForm1.ComboBox1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  FTyped:=FTyped+chr(Key);
  Key:=0;
  timer1.enabled:=false;
  timer1.enabled:=true;
end;

regards

0
 
TheRealLokiSenior DeveloperCommented:
I can't seem to recreate this. what settings are you using in the combobox? e.g style and sorted. is the drop down list displayed when you do this or not.
I'm just not getting it, it's working as expected
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now