Re: [問題]關於GUI問題
先用inputdlg問要幾個edit 再用迴圈產生edit
prompt = 'Enter a Number :';
dlg_title = 'Enter a Number :';
num_lines = 1;
def = {'1'};
answer = inputdlg(prompt,dlg_title,num_lines,def);
answer=str2double(answer{1});
step=30; % edit彼此的間隔
pos=[10 10 60 20]; % 第一個edit的位置與大小
for i=1:1:answer
cc=uicontrol('Style','Edit','Position',pos);
pos=get(cc,'Position');
pos(2)=pos(2)+step; % 向上堆疊edit
end
※ 引述《chenmish (arlibuda)》之銘言:
: 我想設計一個GUI,當輸入一個變數N後,會再產生N個edit讓我輸入變數,
: 一直想不出要怎麼設計,也有找了幾本書,但都是滿基本的設定,
: 希望有人能指導我一下,感謝~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.110.228.232
推
02/18 08:16, , 1F
02/18 08:16, 1F
討論串 (同標題文章)