How to change radio button group selection including the blue highlight circle

조회 수: 3 (최근 30일)
Hi all,
i am using App Designer to build an app including a radio button group. I want to be able to change the selection by mouse click (works fine) but also by using the arrow keys. When using the mouse to change from left to right radio button it looks like this:
I also have created a KeyPressFcn that works mainly fine. But when i change the button groups selection by code with the KeyPressFcn, only the black dot moves, but not the blue highlight circle:
Hereby it doesn't matter if i use
app.rightbutton.Value = true;
or
app.buttongroup.SelectedObject = app.rightbutton
Any idea how to get the blue circle to move as well when using code to change the selction or how to disable it completely?
Regards,
Matthias
  댓글 수: 2
Taylor
Taylor 2024년 3월 21일
I'm having trouble reproducing this behavior. I'm only able to get UIFigureKeyPress to trigger when I select outside of the radio button group which removes the blue circle altogether. Would you mind attaching your app or a watered down version of it?
Matthias Fath
Matthias Fath 2024년 3월 21일
편집: Matthias Fath 2024년 3월 21일
Hi Taylor,
thanks for your response. I attached a simple version of the problem. In my original app and in the simplified version i had to define a KeyPressFcn and a WindowKeyPressFcn as well. If only the KeyPressFcn is defined, i cannot use the arrows when a radio button is selected by mouseclick (when it also gets the blue circle). I guess this is part of the problem.
Regards,
Matthias

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

채택된 답변

Matthias Fath
Matthias Fath 2024년 3월 21일
Found it. Just had to add:
focus(app.buttonname);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by