How can I load data from popup menu in figure 1 into edit text in figure 2?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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?
0 commentaires
Réponse acceptée
Walter Roberson
le 4 Mai 2013
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);
0 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Dates and Time dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!