フィルターのクリア

Clear button on drop down list

8 ビュー (過去 30 日間)
Juan Ruiz Osorio
Juan Ruiz Osorio 2023 年 1 月 14 日
移動済み: Voss 2023 年 1 月 17 日
Hi everyone,
I'm looking for a way to activate a "Clear button" for a drop down list in app designer (Similar to the one in the attached pincture" but I can't find it. This probably was asked before but I didn't find a similiar question.
Thanks in advance.
  5 件のコメント
Juan Ruiz Osorio
Juan Ruiz Osorio 2023 年 1 月 15 日
編集済み: Juan Ruiz Osorio 2023 年 1 月 15 日
The DDL as I use it is necessary because the items list is large. As the user writes, the options gets reduced. With a normal DDL it would be difficult to find values. A normal text box doesn't show's the suggestions as the user writes The clear button is not 100% necessary to use the DDL, but I just want to make the component a bit nicer
Adam Danz
Adam Danz 2023 年 1 月 15 日
I'm not entirely sure what the goal is but if you'd like to give your app users the option to easily select an emply item in your listbox, you could include an empty item as Rik mentioned and then add a uibuttone next to the dropdown that merely selects the empty item.
If the goal is to clear the dropdown list entirely, you could use a button as I've described above and set its callback function to clear the list or you could include a "clear all" option within the dropdown list that, when selected, clears the entire list (except for the clear-all option).

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

採用された回答

Juan Ruiz Osorio
Juan Ruiz Osorio 2023 年 1 月 16 日
移動済み: Voss 2023 年 1 月 17 日
Thanks Adam and Rik for your suggestions. Based on your answers I did the following and I think it works well.
I added an "Image" component with the clear button Icon, and then assigned it an ImageClicked callback that delete the text.
It would be nice if Matlab adds an option for this component that enables the user to activate or deactivate this "clear button" just as is done with Visible,Editable, Enable and so on.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by