Is there any way to implement autocomplete function in an edit text with a popup menu?

1 回表示 (過去 30 日間)
Hi
I am creating a GUI in which the user searches for a string among other 400 strings. Is there any posibility that the user introduces the first 4 or 5 letters in the edit text and a popup menu displays all the possible matches ?
Thanks a lot!

採用された回答

Ingrid
Ingrid 2015 年 4 月 3 日
I have done this two years ago but it was not easy I must say. I finally used a keyPressFunction to detect which strings were typed in and then searched for this string in the cell array and then show the results in a listbox. The desired input could than be selected with the arrows and pressing enter. In my case a partial match was found i.e. can also be in the middle, does not have to start with the letters provided as this was suitable for my application but this can easily be modified.
You can download the source code from
https://www.dropbox.com/s/hrmvunbtwjrd5jb/GUIexampleEditTextFillsList.zip?dl=0
and pick out the relevant code from there. Hope this helps you to spend less time than me. I am sorry for the comments in Dutch, but the code should be self-explantory. If you have any more question you can always contact me.
  6 件のコメント
Vish Chandrasekaran
Vish Chandrasekaran 2020 年 3 月 12 日
Cannot reach your dropbox link. Can you please post a snapshot of the code or a readable code here.
Thanks,
Sadhvi.
Arslan Khan
Arslan Khan 2021 年 3 月 18 日
kindly share the code Please!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSoftware Development Tools についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by