Board index » delphi » AutoComplete triggers OnClick?

AutoComplete triggers OnClick?

Why does a TComboBox fire the OnClick method when it finds a match to
the first character I type?  If I have to type three characters to
scope down to the one entry I am interested in, three OnClick events
are triggered.  What should I use instead of OnClick to do the work I
want done when I select a particular entry?

Bill

 

Re:AutoComplete triggers OnClick?


Quote
In article <1c7votcuc3pnr07qhjgrkuolivli2f1...@4ax.com>, Bill wrote:
> Why does a TComboBox fire the OnClick method when it finds a match to
> the first character I type?  

There is some logic to this. The combobox is unable to read the users
mind, so it has no idea when the correct item has been found. The user
can type a letter, be satisfied with the result and tab on to another
control. Or he scrolls around the list for minutes on end and finally
tabs on. So if you need to do an action when the selection has been
completed you may have to either provide an explicit trigger for the
user (a button for example) or you may have to wait until the controls
OnExit event fires and thus indicates that the user has left the
control for greener pastures.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Note: I'm unable to visit the newsgroups every day at the moment,
so be patient if you don't get a reply immediately.

Other Threads