フィルターのクリア

Tabs in App designer

17 ビュー (過去 30 日間)
Niels Hawinkel
Niels Hawinkel 2024 年 1 月 5 日
回答済み: Ramtej 2024 年 1 月 9 日
I want to make an app that has different Tabs in it, each containing a Listbox. However, with my code I can only seems to access the first tab. For Instance, the line "handles.listRuns.String = ["Insert scenario here"];" does seem to work for the first listbox, but "handles.listRuns2.String = ["Insert scenario here"];" doesnt seem to work for listbox2 (=listRuns2).
  2 件のコメント
Voss
Voss 2024 年 1 月 5 日
Can you upload your .mlapp file as an attachment (using the paperclip button)?
Niels Hawinkel
Niels Hawinkel 2024 年 1 月 9 日
The lines I'm talking about are 88-90

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

回答 (1 件)

Ramtej
Ramtej 2024 年 1 月 9 日
Hi Niels,
I understand that you are not able to access the Listboxes in other tabs. I assume you have migrated the app from GUIDE to App Designer.
The object "handles.listRuns" is of type "UIControlPropertiesConverter", you can set the string to display and value using "String" and "Value" property. I can see that "handles" structure does not contain "listRuns_Int" field.
You are creating a new field "listRuns_Int" of type struct in "handles" by executing the below lines in your code.
handles.listRuns_Int.String = ["Insert here"];
handles.listRuns_Int.Value = 1;
However, you can access the Listbox "listRuns_Int" using "app" object in your callback function as shown below.
app.listRuns_Int.Items = {"Insert here"};
app.listRuns_Int.Value = {"Insert here"};
Since, I do not have a clear idea on why "handles" object does not contain "listRuns_Int" field. I suggest you to refer the below docmentation for the detailed instructions on how to write callback functions and update component properties.
Hope this resolves you query!

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by