how to manage static texts when radio button clicked?

조회 수: 4 (최근 30일)
Jihad Chamseddine
Jihad Chamseddine 2014년 7월 30일
댓글: Jihad Chamseddine 2014년 7월 30일
I have the below image where you will see the gui i'm working with. what i want is when i clickon the Donor radiobutton, the variables will show as they are in the image so no problem(ND, EDON...), but what i want is when i click on the Acceptor radiobutton, these variables change to another variable names, knowing that those variables are done by uisng static text, so how can I do it? thanks

채택된 답변

Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014년 7월 30일
Hi,
Lets assume you created this in GUIDE and Donor radio button has the tag value of donor_radio acceptor is acceptor_radio and static texts are stat_txt1 stat_txt2 and ...
You have to write a code in the radio buttons callback to set the static text strings.
function donor_radio_Callback(hObject,eventdata,handles)
set(stat_txt1,'String','what ever you want to change it to');
set(stat_txt2,'String','Another different message if u want');
and so on!
  댓글 수: 3
Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014년 7월 30일
very welcome ;)
Jihad Chamseddine
Jihad Chamseddine 2014년 7월 30일
i have another question please, i want when i click on a radiobutton, the other will uncheck, because now if i click on the first radiobutton and then i click on the second radiobutton, they both are checked and this is not what i want thanks

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Display and Exploration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by