How to create gui objects based on user input??(dynamically)

2 ビュー (過去 30 日間)
Vaidheeswara Sharma
Vaidheeswara Sharma 2011 年 12 月 7 日
for example if user inputs 5 in a edit text box then it must display 5 edit text boxes from which i can collect data...

採用された回答

Sean de Wolski
Sean de Wolski 2011 年 12 月 7 日
How about using a uitable instead?
doc uitable
Else use a for-loop to build n edit boxes where n is constrained to be below some large number.
  3 件のコメント
Sean de Wolski
Sean de Wolski 2011 年 12 月 7 日
Then change their 'visible' property 'on'/'off'. But let me reirterate - I think a uitable or perhaps an input dialog (doc inputdlg) are a better approach.
Vaidheeswara Sharma
Vaidheeswara Sharma 2011 年 12 月 7 日
Thanks dude... i'll work on it!!

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 12 月 7 日
edit_handles = zeros(n,1);
for K = 1 : n
edit_handles(K) = uitable('Style','edit','Units','normalized', [(K-1)/n, 0, 1/n, 1]);
end
  1 件のコメント
Vaidheeswara Sharma
Vaidheeswara Sharma 2011 年 12 月 7 日
Thanks a lot....i was just trying to figure the code myself...

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

カテゴリ

Help Center および File ExchangeVariables についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by