Automatically clearing-out a TAdvEdit after SearchLookupIndexSelect event

Hello,

I often use the TadvEdit as a way for my users to search though a list of options (an example can be seen in the screenshot collage at the bottom of https://www.qppstudio.net/webhelp_xv4/index.htm?contextid=104220).

Overall it works really well.

But there is one tweak which I have not managed to implement. Once the user selects one of the proposed options, and triggers the SearchLookupIndexSelect event, then I would like the TAdvEdit text field to be empty again (ie. I do not want to display the selected item, I just want to react to it).

I have tried to set the text to '' again, but I always end up with the text of the selected item.

Can you suggest a solution ?

Very best regards,

Olivier

Do you have more detail?
TAdvEdit full property settings and from where exactly you set the Text property to empty string? From a TAdvEdit event? Other?

I use the OnExit(), but it seems that this happens at the time that the lookup list is displayed, so it never fires afterwards (unless I click inside the edit and then outside).

I also tried OnLookupSelect(), but it made no difference.

What I would need is the equivalent of the OnComboCloseUp() that exists for the TAdvStringGrid.

I also tried to force the OnExit() to fire, by adding the code below at the end of the LookupIndexSelect(), but it made no difference.

   SearchEdit.Text := '';
   tree1.SetFocus;
   SearchEdit.SetFocus;
   tree1.SetFocus;

Found the solution.

I had not noticed the var Value: string in the prototype of SearchEditLookupIndexSelect().

Setting Value := '' in the event handler does what I am looking for :-) :smiley:

Thanks for reporting all is fine now!

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.