How to switch uitab using commands?

2 ビュー (過去 30 日間)
Albert Bing
Albert Bing 2022 年 5 月 11 日
コメント済み: Albert Bing 2022 年 5 月 11 日
I wrote a GUI program and needed to switch uitabs. Is it possible to switch to next uitab using command? Suppose I had 2 axeses, ax1 & ax2, axis(ax2) would switch to ax2, so how to switch uitab using commands?
If not possible, how to send a shortkey in MATLAB? If I can send a shortkey "ctrl+tab" using a command, it will do the uitab switching job.
P.S. the program uses figure, not uifigure.

採用された回答

cr
cr 2022 年 5 月 11 日
編集済み: cr 2022 年 5 月 11 日
Use SelectedTab property of uitabgroup.
E.g.
f = figure;
tabgp = uitabgroup(f,'Position',[.05 .05 .3 .8]);
tabA = uitab(tabgp,'Title','Tab A');
tabB = uitab(tabgp,'Title','Tab B');
tabgp.SelectedTab = tabA; % Switch to tab A
tabgp.SelectedTab = tabB; % Switch to tab B
Regards
  1 件のコメント
Albert Bing
Albert Bing 2022 年 5 月 11 日
Ah, it's a property of uitabgroup, a litttle like the case in uibuttongroup.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by