How can I load data from popup menu in figure 1 into edit text in figure 2?

1 次查看(过去 30 天)
I use popup menu to make such as calendar in GUI, I use 2 figures, one for saving all data, and another for load data from figure 1. My calender consist of 3 popup menus, they're for date, month, and year. In figure 2, I'm going to load data from 3 popup menus into 1 edit text. What I'm expect is this edit text will consist of "data+month+year". But I haven't found the way it can possible yet. Could you help me?

采纳的回答

Walter Roberson
Walter Roberson 2013-5-4
alldates = cellstr(get(handles.popup1, 'String'));
idx = get(handles.popup1, 'Value');
thisdate = alldates{idx};
allmonth = cellstr(get(handles.popup2, 'String'));
idx = get(handles.popup2, 'Value');
thismonth = allmonth{idx};
allyear = cellstr(get(handles.popup3, 'String'));
idx = get(handles.popup3, 'Value');
thisyear = allyear{idx};
datestring = [thisdate, '+', thismonth, '+', thisyear];
set(handles.edit1, 'String', datestring);

更多回答(1 个)

Indri Djon Hansemit
well thankyou Mr. Roberson, finally I did it.. :D

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by