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

조회 수: 3 (최근 30일)
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 CenterFile Exchange에서 Variables에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by